{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "slideshow": {
     "slide_type": "skip"
    }
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "import scipy.stats as stats\n",
    "from tabulate import tabulate"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# 数理统计基础\n",
    "> 数据样本分析从分析数据样本分布开始"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "## 数据分布分析\n",
    "\n",
    "\n",
    "### 样本\n",
    "\n",
    "\n",
    "\n",
    "| Name     | Salary      |\n",
    "|----------|-------------|\n",
    "| Dan      | 50,000      |\n",
    "| Joann    | 54,000      |\n",
    "| Pedro    | 50,000      |\n",
    "| Rosie    | 189,000     |\n",
    "| Ethan    | 55,000      |\n",
    "| Vicky    | 40,000      |\n",
    "| Frederic | 59,000      |\n",
    "\n",
    "\n",
    "#### 均值\n",
    "\n",
    "\n",
    "\n",
    "\\begin{equation}\\bar{x} = \\frac{\\displaystyle\\sum_{i=1}^{n}x_{i}}{n}\\end{equation}\n",
    "\n",
    "\n",
    "\\begin{equation}\\bar{x} = \\frac{50000+54000+50000+189000+55000+40000+59000}{7} = 71000 \\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "71000.0"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000]})\n",
    "\n",
    "df['Salary'].mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 中值\n",
    "\n",
    "把数据进行排序\n",
    "\n",
    "| Salary      |\n",
    "|-------------|\n",
    "| 40,000      |\n",
    "| 50,000      |\n",
    "| 50,000      |\n",
    "| 54,000      |\n",
    "| 55,000      |\n",
    "| 59,000      |\n",
    "| 189,000     |\n",
    "\n",
    "取中间的位置${\\frac{n+1}{2} = 4}$\n",
    "\n",
    "| Salary      |\n",
    "|-------------|\n",
    "| 40,000      |\n",
    "| 50,000      |\n",
    "| 50,000      |\n",
    "|***>54,000*** |\n",
    "| 55,000      |\n",
    "| 59,000      |\n",
    "| 189,000     |\n",
    "\n",
    "如果是奇数个元素，则\n",
    "\n",
    "\\begin{equation}\\frac{n}{2} \\;\\;\\;\\;and \\;\\;\\;\\; \\frac{n}{2} + 1\\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "54000.0"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000]})\n",
    "\n",
    "df['Salary'].median()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 众数\n",
    "\n",
    "如果选出现频率最高的数字时\n",
    "\n",
    "\n",
    "| Salary      |\n",
    "|-------------|\n",
    "| 40,000      |\n",
    "|***>50,000***|\n",
    "|***>50,000***|\n",
    "| 54,000      |\n",
    "| 55,000      |\n",
    "| 59,000      |\n",
    "| 189,000     |\n",
    "\n",
    "应该是***50,000****"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    50000\n",
       "dtype: int64"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000]})\n",
    "\n",
    "df['Salary'].mode()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "##### 多个众数\n",
    "很显然，众数可能有多个\n",
    "\n",
    "| Salary      |\n",
    "|-------------|\n",
    "| 40,000      |\n",
    "|***>50,000***|\n",
    "|***>50,000***|\n",
    "| 54,000      |\n",
    "|***>59,000***|\n",
    "|***>59,000***|\n",
    "| 189,000     |"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    50000\n",
       "1    59000\n",
       "dtype: int64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,59000,40000,59000]})\n",
    "\n",
    "df['Salary'].mode()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 分布密度\n",
    "\n",
    "找到中心点之后，希望获得更多关于分布形状的信息。\n",
    "\n",
    "先从最大值和最小值开始："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-----  -----  -------  -------  ------\n",
      "min    mode   media    mean     max\n",
      "40000  50000  54000.0  71000.0  189000\n",
      "-----  -----  -------  -------  ------\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000]})\n",
    "s = df['Salary']\n",
    "print(tabulate([['min','mode','media','mean','max'],\n",
    "                [s.min(),s.mode()[0],s.median(),s.mean(),s.max()]]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "##### 可视化\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEICAYAAABMGMOEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XucHXV9//HX24SLKEpiouRKEkA0KNclaNGKikmgCir91USwiEIoQuutoSA+AKOtNWktDwpCQCNIQsLdRhvMRYuXKiS7COEa2QQqa6IEgiAXgcDn98d8l3NycnbP7GZn52zyfj4e8zgz3/nOzGcnm/PZ+c535quIwMzMrJFXlR2AmZkNDE4YZmaWixOGmZnl4oRhZma5OGGYmVkuThhmZpaLE4ZtFyQ9LOmosuPoJOkWSSf10b7eLWlN1XKf/qyS7pV0ZF/tz7ZfThjWNCS9S9IvJT0paZOk/5V0WNlx1ZIUkp6R9LSkxyX9WNLHqutExNERcVXOfe3TXZ2I+HlE7LetcafjXSnpazX73z8ibu2L/dv2zQnDmoKk1wE/BP4TGAqMAr4CPF/wcQf3ctMDI+K1wH7AlcDFks7vs8CSbYjPrM85YVizeDN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"text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000]})\n",
    "\n",
    "salary = df['Salary']\n",
    "salary.plot.hist(title='Salary Distribution', color='lightblue', bins=25)  \n",
    "plt.axvline(salary.mean(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(salary.median(), color='green', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "<span style=\"color:magenta\">***均值***</span> 和 <span style=\"color:green\">***中值***</span> 用绿色和紫色虚线标出:\n",
    "\n",
    "- 直方图的高度是对应的样本数\n",
    "- 可见，大部分样本在40000和55000之间\n",
    "- 均值高于中值\n",
    "\n",
    "直方图给出了分布密度的信息，在上图基础上绘制密度曲线："
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "> [高斯概率密度估计](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gaussian_kde.html?highlight=gaussian_kde#scipy.stats.gaussian_kde)文档\n",
    "\n",
    "![gaussian_kde_snapshot](http://bazhou.blob.core.windows.net/learning/mpp/gaussian_kde.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAD8CAYAAABZ/vJZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC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elxBO7D98l8jv8f2oWNcdxS7aMeMVbj/9i9EpbfZ3t8svk3yCTGWp+voCaBxOk4tgb+EtqeBwyK23EEjsH3F74KzAVKozyOuV70JLqIiGSlufeBiIhIA1ECERGRrCiBiIhIVpRAREQkK0ogIiKSFSUQERHJihKIiIhkRQlERESy8v8BcbLKYcnqDiQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000]})\n",
    "\n",
    "salary = df['Salary']\n",
    "density = stats.gaussian_kde(salary)\n",
    "n, x, _ = plt.hist(salary, histtype='step', density=True, bins=25)  \n",
    "plt.plot(x, density(x)*5)\n",
    "plt.axvline(salary.mean(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(salary.median(), color='green', linestyle='dashed', linewidth=2)\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    ">概率密度曲线的形状并不对称\n",
    "\n",
    "- 峰值在左边，右边有一个长尾\n",
    "  因为右侧的值把均值给拉向右边，所以叫右偏态分布\n",
    "\n",
    "- 再看一个左偏态分布的例子\n",
    "\n",
    "| Name     | Hours |\n",
    "|----------|-------|\n",
    "| Dan      | 41    |\n",
    "| Joann    | 40    |\n",
    "| Pedro    | 36    |\n",
    "| Rosie    | 30    |\n",
    "| Ethan    | 35    |\n",
    "| Vicky    | 39    |\n",
    "| Frederic | 40    |"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUg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TCgMgJOAhdEkbLwd/J3rZGYHZYadzuc/kEwEd7/W3btlfv6GEZZKuYgU9ElNSbhAdhfgzswHca2Ae919mpnNByaZ2U+BfxGWQEiaurZtC7AEeDF81sOD7n5DhDkbo9ZtizhTLtX1Z/cccI+ZXQ2sI5lHOtW1baOAB8ysinBEyeVRhsyxH5D8PvkcnaEqIpJCsZ+WERGRhlO5i4ikkMpdRCSFVO4iIimkchcRSSGVu4hICqncRURSSOUuIpJC/w8C54RdPjLzHwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Hours':[41,40,36,30,35,39,40]})\n",
    "\n",
    "hours = df['Hours']\n",
    "density = stats.gaussian_kde(hours)\n",
    "n, x, _ = plt.hist(hours, histtype='step', normed=True, bins=25)  \n",
    "plt.plot(x, density(x)*7)\n",
    "plt.axvline(hours.mean(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(hours.median(), color='green', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "- 下面是一个正态分布的例子\n",
    "\n",
    "| Name     | Grade |\n",
    "|----------|-------|\n",
    "| Dan      | 50    |\n",
    "| Joann    | 50    |\n",
    "| Pedro    | 46    |\n",
    "| Rosie    | 95    |\n",
    "| Ethan    | 50    |\n",
    "| Vicky    | 5     |\n",
    "| Frederic | 57    |"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8C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plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import scipy.stats as stats\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "grade = df['Grade']\n",
    "density = stats.gaussian_kde(grade)\n",
    "n, x, _ = plt.hist(grade, histtype='step', normed=True, bins=25)  \n",
    "plt.plot(x, density(x)*7.5)\n",
    "plt.axvline(grade.mean(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(grade.median(), color='green', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "一个对称的钟形曲线 The <span style=\"color:magenta\">***均值***</span>, <span style=\"color:green\">***中值***</span>, 和众值重合.\n",
    "\n",
    "这就是最著名的正态分布（高斯分布）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 偏度和峰度\n",
    "\n",
    "通过测量这两个指标获取关于数据分布形状的认识："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Salary skewness: 2.57316410755049\n",
      "Salary kurtosis: 6.719828837773431\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAD9CAYAAACSoiH8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2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IHM2o+71cV+S7SOlIXB0YHAD1347CGNHP996584OSb6HqSiK/6fhbfD704H4A0zOzCNHGtzP5YBDzlvPv5ThtZp5Fhb+xH83TMeCtP/wt+JfK+4KeZYqz+Paaurz8qifgGnsWcQ/V/sPWB2eZgexd4DZtPDdA/2HpRbgR+QywvTndkzKNcjjdxeAg4N078Cbg+v2IGxCWF6AHsPvs0P7a3wYyn7h9dKoFWYtyD03T34dnYV8zsOKAH2DTGmAFdmwn7k25851/p+S7SOKuTYD393hjYV+lV5/1T1e5BqjhXmrWLPGEgm7cdLgVvCdHf8Rz+WSfsRWAqcFqb7AIui3o81+Yr8D3udbejeBaQL/oyG0vCDs/ssjibhfWmY3yVm+ZvwZ3AsI+YsJvzZFO+HeTelmdvRwEJgMfBI+MEpwA/+Lw9fd/8QGf5hXB8A7wDFMXEuDrmXAj+JaS8G3g3L3Eklg4CV5Phr4L0Q577wyxnpfgQewI/J7MT/hzaiLvZbonVUIcdS/B+7t8LrL+nun3S+B6nkWGH+KvYUkEzaj/nAP0LsN4DembYfgZPw44VvA/OAY6PcjzX90pXoIiKSlmwfAxERkVqiAiIiImlRARERkbSogIiISFpUQEREJC0qICIikhYVEBERSYsKiIiIpOX/AylD2sNl1S7jAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "Hours skewness: -1.194570307262883\n",
      "Hours kurtosis: 0.9412265624999989\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAHdBJREFUeJz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RNCvzJFlWhPtn3H0j8DxwHNA8sdQBlL0kQlZJ6ltfADP7DZALXBNhWWmR1LeTgA5AgZmtAPZJ3PiW1Ur97AqBxxMPPQl8I6Ky0iKpb/2AY5L+svw3cEJUde2FHsCAxO/fBMJwzB3ELE8gC8LdzHLNrHni80ZAb8IbIf8lLHUAYemDp6KpsOrK6ds7ZnYpcCow5LOx22xTTt/mufvX3L2tu7cFtib2AMg65f3sgEmEwADoBbwbTYVVt4d/c83M7PBEsz58+Q3JrODu17t768Tv32DCUinnEoM8KS2lO1QjdhDwYOKNuDrAo+4+xcwWARPM7PfAG4QlELJNeX0rBlYCr4b3enjC3UdFWGdVlNm3iGtKp/J+drOBR8zsZ8AWsnOmU3l9uwx43MxKCDNKLo6yyDS7juzPky/RHaoiIjGU8cMyIiJSeQp3EZEYUriLiMSQwl1EJIYU7iIiMaRwFxGJIYW7iEgMKdxFRGLo/wG0MzRpmHSNVwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "Grade skewness: -0.06512433009682762\n",
      "Grade kurtosis: 2.7484764913773034\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl8VNX5x/HPQ8IOsivIIqi4gLsRRYQiKIsLm6jgBopSW2ndW7Qu1arVLtpaUUTRoqiIgEoFiwtudUHADVDRFBECqCAgshPy/P44w8+YBjMhmdzJ3O/79eLFzJ0zkyeTm+/cnHvuOebuiIhIPFSJugAREak4Cn0Rk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wMXEvrwY7l/lJZCX0QkRtS9IyISIwp9EZEYUeiLiMSIQl9EJEYU+iIiMaLQFxGJEYW+iEiMKPRFRGLk/wDOfGKW5qWOxgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,30,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "numcols = ['Salary', 'Hours', 'Grade']\n",
    "for col in numcols:\n",
    "    print(df[col].name + ' skewness: ' + str(df[col].skew()))\n",
    "    print(df[col].name + ' kurtosis: ' + str(df[col].kurt()))\n",
    "    density = stats.gaussian_kde(df[col])\n",
    "    n, x, _ = plt.hist(df[col], histtype='step', density=True, bins=25)  \n",
    "    plt.plot(x, density(x)*6)\n",
    "    plt.show()\n",
    "    print('\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 测量变化\n",
    "\n",
    "\n",
    "#### 范围\n",
    "\n",
    "先用最大值减最小值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Salary range: 149000\n",
      "Hours range: 11\n",
      "Grade range: 90\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,30,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "numcols = ['Salary', 'Hours', 'Grade']\n",
    "for col in numcols:\n",
    "    print(df[col].name + ' range: ' + str(df[col].max() - df[col].min()))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 百分比 四分位数\n",
    "\n",
    "\n",
    "##### 百分比\n",
    "例如\n",
    "\n",
    "\\begin{equation}\\frac{5}{7} \\times 100 \\approx 71.4\\end{equation} "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71.42857142857143\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,30,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "print(stats.percentileofscore(df['Grade'], 57, 'strict')) # 和下面的weak比较"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "根据是否包含被统计的样本本身，还有另外一种算法\n",
    "\n",
    "\\begin{equation}\\frac{6}{7} \\times 100 \\approx 85.7\\end{equation} "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "85.71428571428571\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,30,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "print(stats.percentileofscore(df['Grade'], 57, 'weak'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "如果要测量50分组的等级，50分有三个样本，把其中一个归类到高分组，把另一个归类到低分组。\n",
    "\n",
    "\\begin{equation}(\\frac{4}{7}) \\times 100 \\approx 57.14\\end{equation} \n",
    "\n",
    "这样可以算出50分组的等级"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "57.142857142857146\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,30,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "print(stats.percentileofscore(df['Grade'], 50, 'rank')) # 单独计算得分组里面的一个\n",
    "print(stats.percentileofscore(df['Grade'], 50, 'weak'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71.42857142857143\n",
      "-----------------  -----------------  ------------------\n",
      "strict             weak               rank\n",
      "28.57142857142857  71.42857142857143  57.142857142857146\n",
      "-----------------  -----------------  ------------------\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,30,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "print(tabulate([['strict','weak','rank'],\n",
    "                [stats.percentileofscore(df['Grade'], 50, 'strict'),\n",
    "                 stats.percentileofscore(df['Grade'], 50, 'weak'),\n",
    "                 stats.percentileofscore(df['Grade'], 50, 'rank')]]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "##### 四分位数\n",
    "\n",
    "以25%，50%，75%为界，把所有样本划分到4个组里："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.25    35.5\n",
       "0.50    39.0\n",
       "0.75    40.0\n",
       "Name: Hours, dtype: float64"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,17,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "df['Hours'].quantile([0.25, 0.5, 0.75])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAHiCAYAAADMP0mlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGGBJREFUeJzt3X3QpXdd3/HP12QxUSCpspaHEFaNlChIkDXgU8U01WioZVpUbHwWMtpSO9JRY63a1Ceoj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QAwIKaA48FlR3sA4MTlmikAgAErUwAAA2IKWBtVdccB97+pql5wtOYB2AoxBRz3quqkoz0DcPwSU8AxoaoeVVW/XVU3Ln+euWz/5ap6+ob97lj+fEpVva6qXprkj6vqE6vqNVV1Q1X9SVV9zVF6K8Bx5uSjPQDABqdW1fUb7n9Sklcvt1+Q5H929+VV9S1JfjrJ0zY53rlJHtvdf1VV/zrJ3u6+MEmq6rQjPDtwgrIyBayTO7v7nP0/SX5gw2Ofl+Sly+1fSfKFWzjetd39V8vtP05yflU9r6q+qLvffeTGBk5kYgo4Vu3/XpcPZ/m7rKoqyQM27PO+j+zc/edJnphVVP1YVW0MNYD7TEwBx4rfTfKM5fZFSa5ebt+SVSQlyb9MsuNgT66qhyf5h+5+cZKfSPI52zYpcEJxzRRwrPiOJC+qqu9Ksi/JNy/bfz7Jq6rq2iS/nQ2rUQd4XJIfr6q7k3woybdv87zACcI3oAMADDjNBwAwIKYAAAbEFADAgJgCABgQUwAAA2IKAGBATAEADIgpAICB/w/HIXIu+++2mAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 720x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,30,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "df['Hours'].plot(kind='box', title='Weekly Hours Distribution', figsize=(10,8))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "箱线图\n",
    "\n",
    "- 矩形（箱）代表 ${\\frac{1}{4} \\to \\frac{1}{2} + \\frac{1}{2} \\to \\frac{3}{4}}$ 两部分\n",
    "- 箱上、下的线分别代表 ${0 \\to \\frac{1}{4}}$ 和 ${\\frac{3}{4} \\to 1}$区间\n",
    "- 中间的绿线代表中值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 例外\n",
    "\n",
    "> 例外往往格外引起注意"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmwAAAHiCAYAAABVx5AQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3X20ZlV9J/jvr6tETRsEpTRKQUNixYB0dPSKpMdOfOnmxWSCf5hpHLut2NVNj22ctKt7Ig69QnxJRzOZIa1R1hAhFLZT6NiZlo46yCDGoccXLrFV0Bhq1EgFlSIFxJeoQH7zx3PKfrzeqgu3Lrm76n4+az3rnvPb++yzD6xV67v2efa91d0BAGBcf2O9JwAAwMEJbAAAgxPYAAAGJ7ABAAxOYAMAGJzABgAwOIENGEJVfamq/t56z2O/qvpAVW1fo7H+blV9fu58TZ+1qm6pques1XjAeAQ2YM1U1bOr6v+tqnuqal9V/aeqeuZ6z2upquqq+mZVfaOq/ryqrquqfzDfp7vP6e6dD3CsJx2sT3f/P9395EOd93S/K6rqDUvGf0p3f3gtxgfGJLABa6Kqjk7yB0nekuQxSY5P8tok33mI77t5lZc+tbsfleTJSa5I8jtVddGaTWxyCPMD+B6BDVgrP54k3b2ru+/v7r/s7g9296eTpKp+rKo+NK1o3VlV76yqY5YbqKpOr6qPVtXdVfWVqvqdqjpqrr2r6hVVdWuSW6vqrVX1vywZ4z9W1b9YadLdfWd3vyPJy5O8pqoeO13/4ar6J9Pxk6rqD6eVwzur6l1T/SP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TAQDA4AQ2AIDBCWwAAIMT2AAABiewAQAMTmADABjc/w8wEFwCM7HpTgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 720x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,30,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "df['Salary'].plot(kind='box', title='Salary Distribution', figsize=(10,8))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "解释\n",
    "\n",
    "例外是距离中值点太远的反常数据。例外总需要解释，\n",
    "\n",
    "- 检查数据源有没有错\n",
    "- 排除例外\n",
    "- 接受例外，接受反常是存在的\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmYAAAHiCAYAAABC5QDZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3H3QnlddJ/Dvz4YCK8UWGgo2LUGNLy3aDISKgyAUp7TA0roD2i5IxboRFmZYdYV2dXgTFXbHheHVrYAEeWkZsbRCgXbBKrq8NJUCRcDGUm1MpekroFhJ+e0f9xW9eXiS50mamvMkn8/MPc91/c65zn2udKbznXOu667uDgAA+9937O8JAAAwI5gBAAxCMAMAGIRg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3S3VffnfcDHBysmAEHnKr6gapaN1dan+SL0/FNVXWfJIu9hXmvZfSZ97Yk74rVMmAfsWIGHIjuk+S1VXV4kh1JtmS2rXlbks8muS7JFQsv6u7bqur3dtdngXckeXlm4QzgLvPL/wB7afrts9O6+2f391yAA4MVM4C9UFWvTXJqkifu77kABw4rZgAAg/DwPwDAIAQzAIBBCGYAAIMQzAAABiGYAQAMQjADABjE/wdo+NRA+te3VwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 720x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,17,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "df['Salary'].plot(kind='box', title='Salary Distribution', figsize=(10,8), showfliers=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAHiCAYAAADMP0mlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFuhJREFUeJzt3H+w5XV93/HX213IiiCorD8AZbV1kjWbGM3Wn1SDZjKjJgEnOCO1lKQ3NUZnk9Q4Qt0maqYYTTNNHWq0jExCjdlqiArRNKPFa3QbQ7OgVnTtaJFfQmT9gSARXfHTP+5Zct3Z9d7lfX+cu/fxmNm553zP93y/73P/2H3y+X45NcYIAAD3zwNW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BQAQIOYAgBoEFMAAA1iCgCgQUwBADT8f22SEPFqH4sjAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,17,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "# 考试分数的巨大差别是可以解释的\n",
    "df['Grade'].plot(kind='box', title='Grade Distribution', figsize=(10,8)) \n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAHiCAYAAADMP0mlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFRxJREFUeJzt3Xuw53dd3/HXGxYMISEhZLkkgSy0jIIXBLfcCwKOMxA0YQwzWJpGG4sIU7XIkBSqgFMRWqeWaRGagdEUUcEIJIp1oAEEKlI3AUohdKAhNxLJcgkJESHIu3/8fluPO7ues3mfs+e32cdjZuf8Lt/L+3f+2H3y+X7zo7o7AADcMXfZ7gEAAI5kYgoAYEBMAQAMiCkAgAExBQAwIKYAAAbEFLCpqurqqvqhLTz+16rqIZt0rJdW1RuXj3dVVVfVjk069oOWs951M44HrC4xBUeRqnpOVX2kqm6rqpuWj19QVbUCs/1gVX17GSBfq6rrq+ptVfWP1m7X3cd191UbONb1652zu1/V3T81nX15zr8Tkd197XLW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y7JLm5u79/06cGjnrumQJWxXuTHFNVP7PmtWMPsu0JSW5ahtRTkpy+fP0DSZ5VVfeoquOT/EiSdPctST5XVc9OFje7V9UjtuRTAEcdMQWshF58g/BZSZ5cVZ+rqv+Z5KIk5x9g87ck2V1Ve7JYpfr08hhXJHlrko8l+YMkH1yzz3OTnFdVH89iFezMAGwC34AOADBgZQoAYEBMAQAMiCkAgAExBQAwIKYAAAbEFADAgJgCABgQUwAAA/8P6z5e1j/gFu4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 720x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "# 人多了，“例外”就不突出了\n",
    "df['Grade'].plot(kind='box', title='Grade Distribution', figsize=(10,8))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 方差和标准差\n",
    "\n",
    "##### 方差\n",
    ">方差测量偏离期望的程度\n",
    "\n",
    "\\begin{equation}\\sigma^{2} = \\frac{\\displaystyle\\sum_{i=1}^{N} (X_{i} -\\mu)^{2}}{N}\\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "685.6190476190476"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,17,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "df['Grade'].var()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "##### 标准差\n",
    "\n",
    "\\begin{equation}\\sigma = \\sqrt{\\frac{\\displaystyle\\sum_{i=1}^{N} (X_{i} -\\mu)^{2}}{N}}\\end{equation}\n",
    "\n",
    "- 平方可以去掉负值\n",
    "- 平方根可以统一量纲"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "26.184328282754315"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,17,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "df['Grade'].std()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 正态分布的标准差\n",
    "\n",
    "正态分布是最重要的分布，标准差是一个正态分布不可缺少的测量指标：期望、方差。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8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Yjc7ep28nr6XjSm70dj+n405unvhyZ9pZTyIjojl1JKeRFN+s0QkYdExIhIhNWxWElE/igi34pIuoh8JCLhVsdkBRGZJSJ7RCRbRB61Oh4richAEdkgIlkisltE7rc6JquJiF1EUkXEYx/Z1qR/ASIykLrpJw5ZHYsH+BwYaYyJB/YCv7I4nk7XYEqS7wFxwM2uqUa8lQP4hTEmFpgI3Ovl7wfA/YBHL7igSf/CngcepokHyryNMeYzY8yZVR62UPfMhbcZD2QbY3KMMdXAMuB6i2OyjDHmmDFmp+t1CXXJrkOeuO8KRGQAMAd4vbmyVtKkfx4iMhc4YozZZXUsHuhHwCdWB2GBpqYk8dok15CIxABjgK3WRmKpF6i7SHRv1ReLePV8+iKyFujbxKHHgF8DTc+b2k1d6P0wxqxwlXmMuo/1/+zM2DyEW9OKeBsRCQGWAz83xpy2Oh4riMi1wHFjzA4RmWp1PBfi1UnfGHN1U/tFZBQwGNjlmiFvALBTRMYbY/I6McROdb734wwRWQRcC0w33jnW161pRbyJiPhSl/D/aYz50Op4LDQZmCsis4EAIExE3jHG3GZxXOfQcfpuEJEDQJIxxmsnlXItpPMccKUxpsDqeKzgmldqLzAdOELdFCW3GGN2WxqYRaTuiugfwEljzM+tjsdTuK70HzLGnLs2owfQPn3lrj8DocDnIpImIq9YHVBnc93IPjMlSRbwvrcmfJfJwA+Baa6fiTTXla7yYHqlr5RSXkSv9JVSyoto0ldKKS+iSV8ppbyIJn2llPIimvSVUsqLaNJXSikvoklfKaW8iCZ9pZTyIv8fERwz/XTvN9EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "Udf = pd.DataFrame(np.random.randn(100000, 1), columns=['Grade'])\n",
    "\n",
    "grade = df['Grade']\n",
    "density = stats.gaussian_kde(grade)\n",
    "n, x, _ = plt.hist(grade, color='lightgrey', density=True, bins=100)  \n",
    "plt.plot(x, density(x))\n",
    "\n",
    "s = df['Grade'].std()\n",
    "m = df['Grade'].mean()\n",
    "\n",
    "x1 = [m-s, m+s]                                # 1 𝛔\n",
    "y1 = [0.25, 0.25]\n",
    "plt.plot(x1,y1, color='magenta')\n",
    "plt.annotate('1s (68.26%)', (x1[1],y1[1]))\n",
    "\n",
    "x2 = [m-(s*2), m+(s*2)]                        # 2 𝛔\n",
    "y2 = [0.05, 0.05]\n",
    "plt.plot(x2,y2, color='green')\n",
    "plt.annotate('2s (95.45%)', (x2[1],y2[1]))\n",
    "\n",
    "x3 = [m-(s*3), m+(s*3)]                        # 3 𝛔\n",
    "y3 = [0.005, 0.005]\n",
    "plt.plot(x3,y3, color='orange')\n",
    "plt.annotate('3s (99.73%)', (x3[1],y3[1]))\n",
    "\n",
    "plt.axvline(grade.mean(), color='grey', linestyle='dashed', linewidth=1)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "百分之六十八，九十五和九十九\n",
    "> 看起来很难记住，其实很容易"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 归一化\n",
    "\n",
    "\\begin{equation}Z = \\frac{x - \\mu}{\\sigma}\\end{equation}\n",
    "\n",
    "比如\n",
    "\n",
    "\\begin{equation}Z = \\frac{95 - 50.43}{26.184} = 1.702\\end{equation}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 总结数据分布\n",
    ">函数名：describe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              Salary      Hours      Grade\n",
      "count       7.000000   7.000000   7.000000\n",
      "mean    71000.000000  35.428571  50.428571\n",
      "std     52370.475143   8.423324  26.184328\n",
      "min     40000.000000  17.000000   5.000000\n",
      "25%     50000.000000  35.500000  48.000000\n",
      "50%     54000.000000  39.000000  50.000000\n",
      "75%     57000.000000  40.000000  53.500000\n",
      "max    189000.000000  41.000000  95.000000\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,17,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "print(df.describe())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "# 数据比较\n",
    "\n",
    "通过比较发现趋势和关系\n",
    "\n",
    "## 单变量数据\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAD7FJREFUeJzt3XuQnXV9x/H3RyMGJIKQFU1AVlrGu3jZqqhVEccZQA2MOINSihaLt6ladSTVKuhUBetUnVahGRlNFRWMF/BSB4p4q0rdBCzF0IEil5gIqxguERXk2z/Ok3rc7nLOJnuy4cf7NZPZc/k9z/M7O8n7PPs7e3JSVUiS7vnus9ATkCTND4MuSY0w6JLUCIMuSY0w6JLUCIMuSY0w6NopJbkmyfNGuP/bkhwwT/t6W5KPdZfHk1SSRfO074d1c73vfOxPbTPomrMkxyS5OMmWJDd2l1+bJDvB3J6T5K4ugrcl2ZDknC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DLkmNyI58A0aSKeDaHXZAaXhLgZ8v9CSkWexfVWODBu3QoEs7qySTVTWx0POQtodLLpLUCIMuSY0w6FLPqoWegLS9XEOXpEZ4hi5JjTDoktQIg66mJNknyaeTXJ1kbZLvJzlqO/Z3SpK3zOccpVEx6GpGep879yXg21V1QFU9GTgG2HfaOD+pS00y6GrJc4HfVtUZW2+oqmur6h+TvDzJ55J8GTg/ye5JLkyyLsllSVZs3SbJ25P8d5J/Ax7Rd/sfJfl6d+b/nSSP3KGPThrAMxW15DHAuru5/2Dg8VV1U3eWflRV3ZJkKfCDJOcBT6J3Vv9Eev8+1gFru+1XAa+uqiuTPBX4KL0nEWmnYNDVrCQfAZ4J/Bb4CHBBVd209W7gvUmeBdwFLAf2Af4U+GJV/arbx3nd192BpwOf663sAHD/HfRQpKEYdLXkcuDFW69U1eu6s+/J7qYtfWOPBcaAJ1fVHUmuARZv3XSGfd8H2FxVT5j3WUvzxDV0teQbwOIkr+m7bbdZxu4B3NjF/BBg/+72bwNHJdk1yRLghQBVdQvwkyQvgd4LsEkOGsmjkLaRQVczqve25yOBZyf5SZL/AFYDJ80w/CxgIskkvbP1K7p9rAPOBi4FPg98p2+bY4ETkvyI3k8DK5B2Ir71X5Ia4Rm6JDXCoEtSIwy6JDXCoEtSIwy6JDXCoEtSIwy6JDXifwEYjyUL9Mw3FQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAEt5JREFUeJzt3X+MZWd93/H3h7UBxxPWDaYTd710iLDapl4F8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<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "           Grade\n",
      "count  15.000000\n",
      "mean   51.533333\n",
      "std    24.642781\n",
      "min     5.000000\n",
      "25%    41.000000\n",
      "50%    50.000000\n",
      "75%    66.000000\n",
      "max    95.000000\n",
      "median: 50.0\n"
     ]
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "plt.figure()\n",
    "df['Grade'].plot( kind='box', title='Grade Distribution')\n",
    "plt.figure()\n",
    "df['Grade'].hist(bins=9)\n",
    "plt.show()\n",
    "print(df.describe())\n",
    "print('median: ' + str(df['Grade'].median()))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "## 多变量数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Salary</th>\n",
       "      <th>Hours</th>\n",
       "      <th>Grade</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Dan</td>\n",
       "      <td>50000</td>\n",
       "      <td>41</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Joann</td>\n",
       "      <td>54000</td>\n",
       "      <td>40</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Pedro</td>\n",
       "      <td>50000</td>\n",
       "      <td>36</td>\n",
       "      <td>46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Rosie</td>\n",
       "      <td>189000</td>\n",
       "      <td>17</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Ethan</td>\n",
       "      <td>55000</td>\n",
       "      <td>35</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Vicky</td>\n",
       "      <td>40000</td>\n",
       "      <td>39</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Frederic</td>\n",
       "      <td>59000</td>\n",
       "      <td>40</td>\n",
       "      <td>57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Jimmie</td>\n",
       "      <td>42000</td>\n",
       "      <td>45</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Rhonda</td>\n",
       "      <td>47000</td>\n",
       "      <td>41</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Giovanni</td>\n",
       "      <td>78000</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Francesca</td>\n",
       "      <td>119000</td>\n",
       "      <td>30</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Rajab</td>\n",
       "      <td>95000</td>\n",
       "      <td>33</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Naiyana</td>\n",
       "      <td>49000</td>\n",
       "      <td>38</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Kian</td>\n",
       "      <td>29000</td>\n",
       "      <td>47</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Jenny</td>\n",
       "      <td>130000</td>\n",
       "      <td>24</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Name  Salary  Hours  Grade\n",
       "0         Dan   50000     41     50\n",
       "1       Joann   54000     40     50\n",
       "2       Pedro   50000     36     46\n",
       "3       Rosie  189000     17     95\n",
       "4       Ethan   55000     35     50\n",
       "5       Vicky   40000     39      5\n",
       "6    Frederic   59000     40     57\n",
       "7      Jimmie   42000     45     42\n",
       "8      Rhonda   47000     41     26\n",
       "9    Giovanni   78000     35     72\n",
       "10  Francesca  119000     30     78\n",
       "11      Rajab   95000     33     60\n",
       "12    Naiyana   49000     38     40\n",
       "13       Kian   29000     47     17\n",
       "14      Jenny  130000     24     85"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000,42000,47000,78000,119000,95000,49000,29000,130000],\n",
    "                   'Hours':[41,40,36,17,35,39,40,45,41,35,30,33,38,47,24],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "df[['Name', 'Salary', 'Hours', 'Grade']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 数据归一化\n",
    "\n",
    ">要使数据有可比性\n",
    "\n",
    "将数据转换到0和1之间，这样才能比较不同的特征。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAHiCAYAAAAqFoLhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAG6dJREFUeJzt3X+U5Xdd3/HXm91FosR4bLZWk2wWNdqJiwisWOt6YIXaQJTU1mq2/gC6mtZKPKf+YnWQX3U1aqvnGECNLuWHMgHsqQYSJQU3lbUiCUiAMI1nTwhkm1ZAJPIjyAbf/WPu4mTYzd5sPjN3ZvfxOGcO937v536/7yGTyXO+3zt3qrsDAMBD97BZDwAAcLoQVgAAgwgrAIBBhBUAwCDCCgBgEGEFADCIsALWRFX9elX9zKB9bauqj1fVpsn9m6rqB0bse7K/P6iqZ4zaH3Dm2DzrAYDTQ1XdmeRLktyX5DNJ3pvklUmu6e6/6+5//yD28wPd/aYTrenuDyR55EOdeXK8FyT5yu7+3mX7f+qIfQNnHmesgJG+vbvPTnJhkquSPCfJgZEHqCo/EALrlrAChuvue7r7uiTfneQZVbWjql5eVT+bJFV1blW9oao+WlUfqaq3VNXDqupVSbYlef3kUt9PVtX2quqq2ltVH0jyR8u2L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r7o1X1mw+0ZoXfSfKzWYorWG9+JMnLquonsnRJ/Nil699M8vtV9bYkb879f+Jf7tFJfqmq/i7J0SQ/dIJ1sGq6u6vqXyT5lar6ySx9LX8iyXOy9DrY5X4nyeur6pYk70zyvyf7eEdVvWay7f1J3rLsOd+T5Neq6rlZ+iHj2iS3ruKnRLzzOicw+c2qy7r7+2Y9CwBsFM5Y8Tmq6uokT83S608AgCk5YwUAMIgXrwMADCKsAAAGEVYAAIMIKwCAQYQVAMAgwgoAYJD/DxkSVh3SCsDEAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def MinMaxScaler(v):\n",
    "    min = v.min()\n",
    "    max = v.max()\n",
    "    scale = max - min\n",
    "    return [(i - min) / scale for i in v]\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000,42000,47000,78000,119000,95000,49000,29000,130000],\n",
    "                   'Hours':[41,40,36,17,35,39,40,45,41,35,30,33,38,47,24],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "# 归一化\n",
    "df['Salary'], df['Hours'], df['Grade'] = tuple(map(MinMaxScaler, [df['Salary'], df['Hours'], df['Grade']]))\n",
    "\n",
    "df.plot(kind='box', title='Distribution', figsize = (10,8))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 对于双变量数据画散点图\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "out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bkkZLOhV4H0C6F9ELkt4P2WAESe8o5FWYDYDDxqxEIpv1dh7wLkkvSPo+2e2El3TT/KtAo6QmsqOcH6Z9PAk8AGwiuxfRv+a2+RCwUNLTZEdRczEbIjzrs5mZFc5HNmZmVjiHjZmZFc5hY2ZmhXPYmJlZ4Rw2ZmZWOIeNmZkVzmFjZmaF+//QzTJPinCJWwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000,42000,47000,78000,119000,95000,49000,29000,130000],\n",
    "                   'Hours':[41,40,36,17,35,39,40,45,41,35,30,33,38,47,24],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "df.plot(kind='scatter', title='Grade vs Hours', x='Grade', y='Salary')\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "在成绩和收入之间，我们看到了某种趋势。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZsAAAEWCAYAAACwtjr+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xt8V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ai8CX4mImmK2r61IGkU2WWI7YC5wIdkfqCX3/ZD0XeBLZLM4XwT+iewaTUl+N1rCwcbMzHLnYTQzM8udg42ZmeXOwcbMzHLnYGNmZrlzsDEzs9w52Ji1IUm7Svq1pLmSZkmaIemMbTjedZL+pTXbaJYHBxuzNpISAn8HPB0Re0bEoWQJpOUN6nVtbH+zjszBxqztHA98GBG31RdExNsR8VNJF0j6jaTfA3+Q1EvS45JekPQXSWPr95H0LUl/lfTfwN4F5cMl/VfqMT0jaZ82PTuzLfBfUGZtZ3/ghS1sPxI4MCKWp97NGRHxnqT+wExJ08juT3Y22V26u6bj1d88dCJwaUS8KelwYDxZgDMrOgcbsyKRdCvwSeBD4FbgsYJbvwj4vqRjyG4nNAjYFTga+G1EfJCOMS099iK7OeRvstE6ALq30amYNcnBxqztvAqcWf8iIq5IvZbKVPR+Qd0vAwOAQyOiNt2Nukf9ro0cu4xsfZVRrd5qs1bgazZmbecJoIekywrKtt9M3Z3J1teplXQcsEcqfxo4Q1JPSTsCnwNIaxHNk/QFyCYjSDool7MwawEHG7M2Etldb08HjpU0T9KfyZYTHtdI9XuACkmVZL2cN9IxXgDuA14iW4vomYJ9vgxcJOllsl7UWMzaCd/12czMcueejZmZ5c7BxszMcudgY2ZmuXOwMTOz3DnYmJlZ7hxszMwsdw42ZmaWu/8PfO7+Vu+DFiIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000,42000,47000,78000,119000,95000,49000,29000,130000],\n",
    "                   'Hours':[41,40,36,17,35,39,40,45,41,35,30,33,38,47,24],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "df.plot(kind='scatter', title='Grade vs Salary', x='Grade', y='Salary')\n",
    "\n",
    "# 用一条直线来模拟这种趋势\n",
    "plt.plot(np.unique(df['Grade']), np.poly1d(np.polyfit(df['Grade'], df['Salary'], 1))(np.unique(df['Grade'])))\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 相关性\n",
    "\n",
    "让我们用一个统计指标来描述相关性\n",
    "\n",
    "- 这是个-1到1之间的数值\n",
    "- 大于0代表正相关\n",
    "- 小于0代表负相关\n",
    "- 越接近0相关程度越低\n",
    "- 0代表不相关\n",
    "\n",
    "\\begin{equation}r_{x,y} = \\frac{\\displaystyle\\sum_{i=1}^{n} (x_{i} -\\bar{x})(y_{i} -\\bar{y})}{\\sqrt{\\displaystyle\\sum_{i=1}^{n} (x_{i} -\\bar{x})^{2}(y_{i} -\\bar{y})^{2}}}\\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "scrolled": true,
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.8149286388911882\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000],\n",
    "                   'Hours':[41,40,36,17,35,39,40],\n",
    "                   'Grade':[50,50,46,95,50,5,57]})\n",
    "\n",
    "# 调用方法 corr\n",
    "print(df['Grade'].corr(df['Salary']))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "0.8多，说明成绩和收入之间存在很大的正相关性。\n",
    "\n",
    "那么成绩和学习时间呢？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Correlation: -0.8109119058459785\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEWCAYAAABrDZDcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl8leWd9/HPLwsJEHYCQsKSxQUXBEV2gaSO0xaKtOjUum+lKrTOOK3Ydp5n2pnpMyMzrW3ZLGotU63WilbrtJ1ak7CpKJugopKELawhEEiAhCTn9/xxDjVYlpCck3OS832/XrzMuc+9/M7tSb7nuq/rXLe5OyIiEr8Sol2AiIhEl4JARCTOKQhEROKcgkBEJM4pCERE4pyCQEQkzikIJO6Y2VYzuybadYjECgWBxBQzu9HMVpnZETPbF/r5fjOzaNcWLqcKIjO7w8xWRKsmiW8KAokZZvaPwE+A/wTOA/oC9wLjgA6n2Sax1Qpsg8wsKdo1SOxTEEhMMLNuwL8A97v7C+5e5UHr3P1md68NrfcLM1toZr83syNAnplNNrN1ZnbYzHaY2fc+te9bzWybmVWY2Xc/9VyCmT1sZiWh5583s56nqXGTmU1p9DjJzPab2RVmlmpmT4f2UWlm75hZ3xacjyFmVhTa1/tmNrXRc0Vmdk+jxye1JszMzWymmW0GNlvQo6EW1iEz22Bmlza3Nml/FAQSK8YAKcDLTVj3JuAHQBdgBXAEuA3oDkwG7jOzaQBmdjGwELgV6A/0AjIb7esbwDRgYuj5g8D80xz3WeArjR7/LbDf3dcCtwPdgAGhY9wLHGvCa/krZpYM/A74E9AH+DrwjJldeA67mQaMAi4GrgUmABcQPEdfBiqaU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NXMtgLPEWz2/xjoHrocAJAJ7IpOea2uDChz91Whxy8QDIZ4fH9cA2xx93J3rwNeBMYSv++NZlEQxKDQ9e8ngU3u/qNGT70C3B76+Xbg5dauLRrc/dvununugwl2BBa4+81AIXB9aLV4Oh97gB1mdmFo0WeAD4jP98d2YLSZdQr93pw4F3H53mgufbM4BpnZeGA5sJFProl/h2A/wfPAQIK/ADe4+4GoFBklZjYJ+Ka7TzGzbIIthJ7AOuAWd6+NZn2txcyGEew47wCUAncS/GAXd+8PM/s+8GWCo+3WAfcQ7BOIy/dGcygIRETinC4NiYjEOQWBiEicUxCIiMQ5BYGISJxTEIiIxDkFgUiImfU1s1+ZWamZrTGzN83siy3Y3/fM7JvhrFEkEhQEIvzlS3y/BZa5e7a7X0nwy2uZn1ov6VTbi7RlCgKRoHzguLs/dmKBu29z97lmdoeZ/cbMfgf8yczSzOx1M1trZhvN7LoT25jZd83sIzP7M3Bho+U5ZvbHUEtjuZld1KqvTuQM9OlGJOgSYO0Znh8DDHX3A6FWwRfd/bCZ9QbeMrNXCM73cyPB2WKTQvs7MVHeIuBed99sZqOABQTDRyTqFAQip2Bm84HxwHFgPvBao+kaDPh/ZjaB4BQgGUBf4GrgJXc/GtrHK6H/phGcCO03wStQAKS00ksROSsFgUjQ+8D0Ew/cfWbo0/7q0KIjjda9GUgHrnT3utCsqKknNj3FvhMIzo8/LOxVi4SB+ghEggqAVDO7r9GyTqdZtxvB+yPUmVkeMCi0fBnwRTPraGZdgC8AhO4lscXMboBgx7SZXR6RVyHSDAoCEcCDsy9OAyaa2RYze5vgLQ5nn2L1Z4ARZraaYOvgw9A+1gK/BtYTvJfE8kbb3AzcbWbvEmx9XIdIjNDsoyIicU4tAhGROKcgEBGJcwoCEZE4pyAQEYlzCgIRkTinIBARiXMKAhGROPf/AYZ43GkxIg/7AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000,42000,47000,78000,119000,95000,49000,29000,130000],\n",
    "                   'Hours':[41,40,36,17,35,39,40,45,41,35,30,33,38,47,24],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "r = df['Grade'].corr(df['Hours'])\n",
    "print('Correlation: ' + str(r))\n",
    "\n",
    "df.plot(kind='scatter', title='Grade vs Hours', x='Grade', y='Hours')\n",
    "\n",
    "plt.plot(np.unique(df['Grade']), np.poly1d(np.polyfit(df['Grade'], df['Hours'], 1))(np.unique(df['Grade'])))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "学习时间越长，成绩越好，照理如此。\n",
    "\n",
    "请看直线下方的两个异常点，第一名的同学其实和中上等的同学学习时间一样长，我们用有天赋解释。\n",
    "\n",
    "那最后一名呢？他好像根本没有学习，所以取得这样的成绩并不意外。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "## 最小二乘拟合\n",
    "\n",
    "让我们看看*numpy.**polyfit*** \n",
    "\n",
    "对方程\n",
    "\\begin{equation}y = mx + b\\end{equation}\n",
    "\n",
    "可解释为：x和y是两个变量，m是斜率，b是截距。假设我们猜测一条直线，如何计算它和散点之间的差距呢？我们可以让m是使得差距最小的值。\n",
    "\n",
    "\\begin{equation}m = \\frac{n(\\sum{xy}) - (\\sum{x})(\\sum{y})}{n(\\sum{x^{2}})-(\\sum{x})^{2}}\\end{equation}\n",
    "\n",
    "然后根据m计算b\n",
    "\n",
    "\\begin{equation}b = \\frac{\\sum{y} - m(\\sum{x})}{n}\\end{equation}\n",
    "\n",
    "对于数据\n",
    "\n",
    "| Name     | Study | Grade |\n",
    "|----------|-------|-------|\n",
    "| Dan      | 1     | 50    |\n",
    "| Joann    | 0.75  | 50    |\n",
    "| Pedro    | 0.6   | 46    |\n",
    "| Rosie    | 2     | 95    |\n",
    "| Ethan    | 1     | 50    |\n",
    "| Vicky    | 0.2   | 5     |\n",
    "| Frederic | 1.2   | 57    |"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "slope: 1516.1378856076408\n",
      "y-intercept: -5731.639038313754\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZsAAAEWCAYAAACwtjr+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XucXeO9x/HPVy4EjSBB5DZUcFBCpqiiLqFubbSlFS1KzolrS097jlCta1vtKaqqIURFS8JxqSDul+pBIgnqroIJQyoTicQl5OJ3/ljPsOc+mczae2b29/167dfe67eetfazdnbmt59nPc9aigjMzMzytFqpK2BmZl2fk42ZmeXOycbMzHLnZGNmZrlzsjEzs9w52ZiZWe6cbKzTk1QlaUSp69EWnbnuxSbpMkk/K3U9rG2cbCxXkg6TNF3SB5LmpdcnSFKp69ZeJO0q6VFJiyQtkPSIpC+Wul71SYr07/C+pDclXSipW6nr1VoRcVxEnFvqeljbONlYbiT9GLgY+B9gI2BD4Djgy0DPJrbpNH/8ACT1Bm4HLgHWAwYAZwMf5/y+3du46XYRsTbwFeA7wDHtV6uMMv7bYnX4C2G5kLQOcA5wQkTcGBHvRebJiPhuRHycyl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x+jABei4iaiFgG3AzsQvl+N9rEyaZMpfMRE4AXIuLCglVTgKPS66OAW4tdt1KIiNMiYmBEVJCd/H0gIr4LPAgckoqV0+fxL+ANSVuk0N7A85Tn9+N1YGdJa6b/N7WfRVl+N9rKVxAoU5J2Bf4OPMNn5yhOJztvcwMwmOw/2aERsaAklSwRSXsAP4mIgyRtStbSWQ94EvheRHxcyvoVi6RhZIMlegKvAkeT/UAtu++HpLOB75CN4nwS+HeyczRl+d1oCycbMzPLnbvRzMwsd042ZmaWOycbMzPLnZONmZnlzsnGzMxy52RjVkSSNpR0naRXJc2S9Jikb6zC/s6S9JP2rKNZHpxszIokTQj8K/BwRGwaEcPJJpAOrFeue2Pbm3VmTjZmxbMXsDQiLqsNRMSciLhE0vcl/a+k24B7JK0t6X5JT0h6RtLI2m0k/VTSS5LuA7YoiH9e0l2pxfR3SVsW9ejMmuFfUGbFszXwRDPrvwRsGxELUuvmGxGxWFJfYJqkKWTXJzuM7Crd3dP+ai8eOh44LiJelrQT8EeyBGdWck42ZiUi6VJgV2ApcClwb8GlXwT8UtLuZJcTGgBsCOwG3BIRH6Z9TEnPa5NdHPJ/s946AFYv0qGYtcjJxqx4ngO+VbsQESemVsvMFPqgoOx3gX7A8IhYlq5GvUbtpo3sezWy+6sMa/dam7UDn7MxK54HgDUkHV8QW7OJsuuQ3V9nmaQ9gSEp/jDwDUm9JH0O+BpAuhfRa5IOhWwwgqTtcjkKszZwsjErksiuensw8BVJr0l6nOx2wqc2UvxaoFLSTLJWzotpH08A1wNPkd2L6O8F23wXGC3pH2StqJGYdRC+6rOZmeXOLRszM8udk42ZmeXOycbMzHLnZGNmZrlzsjEzs9w52ZiZWe6cbMzMLHf/D9oz+QpNColmAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000,42000,47000,78000,119000,95000,49000,29000,130000],\n",
    "                   'Hours':[41,40,36,17,35,39,40,45,41,35,30,33,38,47,24],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "df['x2'] = df['Grade']**2\n",
    "df['xy'] = df['Grade'] * df['Salary']\n",
    "x = df['Grade'].sum()\n",
    "y = df['Salary'].sum()\n",
    "x2 = df['x2'].sum()\n",
    "xy = df['xy'].sum()\n",
    "n = df['Grade'].count()\n",
    "m = ((n*xy) - (x*y))/((n*x2)-(x**2))  # 公式\n",
    "b = (y - (m*x))/n\n",
    "df['fx'] = (m*df['Grade']) + b\n",
    "df['error'] = df['fx'] - df['Salary']\n",
    "\n",
    "print('slope: ' + str(m))\n",
    "print('y-intercept: ' + str(b))\n",
    "\n",
    "df.plot(kind='scatter', title='Grade vs Salary Regression', x='Grade', y='Salary', color='red')\n",
    "\n",
    "plt.plot(df['Grade'],df['fx'])\n",
    "\n",
    "plt.show()\n",
    "\n",
    "# df[['Grade', 'Salary', 'fx', 'error']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZsAAAEWCAYAAACwtjr+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XucXeO9x/HPVy4EjSBB5DZUcFBCpqiiLqFubbSlFS1KzolrS097jlCta1vtKaqqIURFS8JxqSDul+pBI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UkHV8QW7OJsuuQ3V9nmaQ9gSEp/jDwDUm9JH0O+BpAuhfRa5IOhWwwgqTtcjkKszZwsjErksiuensw8BVJr0l6nOx2wqc2UvxaoFLSTLJWzotpH08A1wNPkd2L6O8F23wXGC3pH2StqJGYdRC+6rOZmeXOLRszM8udk42ZmeXOycbMzHLnZGNmZrlzsjEzs9w52ZiZWe6cbMzMLHf/D9oz+QpNColmAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000,42000,47000,78000,119000,95000,49000,29000,130000],\n",
    "                   'Hours':[41,40,36,17,35,39,40,45,41,35,30,33,38,47,24],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "# 线形回归方法\n",
    "m, b, r, p, se = stats.linregress(df['Grade'], df['Salary'])\n",
    "\n",
    "df['fx'] = (m*df['Grade']) + b\n",
    "df['error'] = df['fx'] - df['Salary']\n",
    "\n",
    "df.plot(kind='scatter', title='Grade vs Salary Regression', x='Grade', y='Salary', color='red')\n",
    "\n",
    "plt.plot(df['Grade'],df['fx'])\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "slope: 1424.5008823224111\n",
      "y-intercept: -7822.237984844818\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZsAAAEWCAYAAACwtjr+AAAABHNCSVQICAg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mjey7HdlnnfRt9qzNmoHHbMzK50Ggs6RvF8TWXE7b9cg+n2eRpAOBzVL8EeBLkrqkO0Z/ASB9PtI0SV+GbDKCpF1K8irMVoGLjVmZRHbX26OA/SVNk/Qk2Z21f9RI8xuAGknjyXo5k9M+ngZuAp4h+3ykRwu2+SowRNJ/yXpRgzCrEL7rs5mZlZx7NmZmVnIuNmZmVnIuNmZmVnIuNmZmVnIuNmZmVnIuNmZmVnIuNmZmVnL/H69F7Cm1Sl5CAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.DataFrame({'Name': ['Dan', 'Joann', 'Pedro', 'Rosie', 'Ethan', 'Vicky', 'Frederic', 'Jimmie', 'Rhonda', 'Giovanni', 'Francesca', 'Rajab', 'Naiyana', 'Kian', 'Jenny'],\n",
    "                   'Salary':[50000,54000,50000,189000,55000,40000,59000,42000,47000,78000,119000,95000,49000,29000,130000],\n",
    "                   'Hours':[41,40,36,17,35,39,40,45,41,35,30,33,38,47,24],\n",
    "                   'Grade':[50,50,46,95,50,5,57,42,26,72,78,60,40,17,85]})\n",
    "\n",
    "df = df[(df['Grade'] > 5) & (df['Grade'] < 95)] # 去掉异常\n",
    "\n",
    "m, b, r, p, se = stats.linregress(df['Grade'], df['Salary'])\n",
    "\n",
    "df['fx'] = (m*df['Grade']) + b\n",
    "df['error'] = df['fx'] - df['Salary']\n",
    "\n",
    "print('slope: ' + str(m))\n",
    "print('y-intercept: ' + str(b))\n",
    "\n",
    "df.plot(kind='scatter', title='Grade vs Salary Regression', x='Grade', y='Salary', color='red')\n",
    "\n",
    "plt.plot(df['Grade'],df['fx'])\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "可以用拟合出来的曲线进行预测，比如一位同学的成绩是62，他最有可能的收入大概是8万多\n",
    "\n",
    "\\begin{equation}f(x) = (1424.50\\times62) - 7822.24 \\approx 80,497 \\end{equation}\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# 概率\n",
    "\n",
    "\n",
    "## 基本概念\n",
    "\n",
    "- 实验，结果不确定\n",
    "- 样本空间，所有实验的所有可能结果\n",
    "- 事件，包含若干样本的实验\n",
    "- 概率，事件发生的概率\n",
    "\n",
    "\\begin{equation}\\text{事件的概率} = \\frac{\\text{事件样本数}}{\\text{样本空间样本数}} \\end{equation}\n",
    "\n",
    "### 记号\n",
    "\n",
    "\\begin{equation}P(A) = 0.167 \\end{equation}\n",
    "\n",
    "### 补\n",
    "\n",
    "\\begin{equation}P(A) = 1 - P(A') \\end{equation}\n",
    "\n",
    "### 偏\n",
    "\n",
    "\n",
    "A 晴, B 阴, C 雨\n",
    "\n",
    "\\begin{equation}P(A)=0.6\\;\\;\\;\\; P(B)=0.3\\;\\;\\;\\; P(C)=0.1 \\end{equation}\n",
    "\n",
    "**A** 的补：不请\n",
    "\n",
    "\\begin{equation}P(A') = 1 - P(A) = 1 - 0.6 = 0.4 \\end{equation}\n",
    "\n",
    "或者\n",
    "\n",
    "\\begin{equation}P(A') = P(B) + P(C) = 0.3 + 0.1 = 0.4 \\end{equation}\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "## 条件概率和独立\n",
    "\n",
    "\n",
    "事件之间的依赖关系可以是：\n",
    "- *独立*\n",
    "- *依赖* \n",
    "- *互斥*\n",
    "\n",
    "### 独立事件\n",
    "\n",
    "抛硬币实验"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[5021, 4979]\n"
     ]
    },
    {
     "data": {
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Fi4R3gMeAR4Pd4wTbLeaQCKqW08HLHs6egPkXjXEL0GlEJPQL8SQv0J59KKY28XAtwFlFJnQ4MshuoqrYB84D/AzyCFyy2nEeqTKWUdl6uHzCO6KLgrm0C8BGbsXppN9Ga138pby8AizUaSjeVUiOKTtRsJboTy95lZfO0g63AG0TF01VCL+ocosajUpI9vNzHgGHA0PL2sQ987fr+sAN41xKwDnirx80Lgur8EJJ0KiU5cF6umWj6lyG6g0vXV0N0E8ZdRFOvXXjBblsxJZlUSiISK41y2FhEEkKlJCKxolISkVhRKYlIrKiUpKqMMR81xszoxfP+VP7qGGNeqn0ySQqVklTbR4H9llIYhifXIYskkEpJqq0AHG2MWWCM+bEx5kljzDxjzCJjzNldTzLGbPngC40xbcaY58uvfdEY01rX5BILWdsBJHVcYGwYhscbY7LAwWEYbjLGDAHmGGMeDfd9ctxlwM1hGP6HMaaZ6IRMaTAqJaklA/zQGPMZostNhhNdprJ2H89/DphpjBkBPBSG4bL6xJQ40fRNaunLQAvQHobh8cDbwEH7enIYhvcCU4lWjXzCGPPXdUkpsaJSkmrbDAwsf58D1oVhuNsYcypwZE8vNMZ8AlgehuFPgUeB8TVNKrGk6ZtUVRiGG4wxz5YP8/8FGGWMeQFYACzdz8v/J3CRMWY30RTv2tqmlTjSBbkiEiuavolIrKiURCRWVEoiEisqJRGJFZWSiMSKSklEYkWlJCKxolISkVhRKYlIrKiURCRWVEoiEisqJRGJFZWSiMSKSklEYkWlJCKxolISkVhRKYlIrKiURCRWVEoiEisqJRGJFZWSiMSKSklEYkWlJCKx8v8Agfv42qr6gJ4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import random\n",
    "\n",
    "heads_tails = [0,0]\n",
    "\n",
    "# 模拟抛硬币10000次\n",
    "trials = 10000\n",
    "trial = 0\n",
    "while trial < trials:\n",
    "    trial = trial + 1\n",
    "    toss = random.randint(0,1)\n",
    "    heads_tails[toss] = heads_tails[toss] + 1\n",
    "\n",
    "print (heads_tails)\n",
    "\n",
    "from matplotlib import pyplot as plt\n",
    "plt.figure(figsize=(5,5))\n",
    "plt.pie(heads_tails, labels=['heads', 'tails'])\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 独立事件乘法律\n",
    "\n",
    "\n",
    "<span style='font-size:48px;color:gold;'><sub>&#10050;</sub></span> = <sup>1</sup>/<sub>2</sub>\n",
    "\n",
    "<span style='font-size:48px;color:gold;'><sub>&#10050;&#10050;</sub></span> = <sup>1</sup>/<sub>2</sub> x <sup>1</sup>/<sub>2</sub>\n",
    "\n",
    "<span style='font-size:48px;color:gold;'><sub>&#10050;&#10050;&#10050;</sub></span> = <sup>1</sup>/<sub>2</sub> x <sup>1</sup>/<sub>2</sub> x <sup>1</sup>/<sub>2</sub>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12.70%\n"
     ]
    }
   ],
   "source": [
    "import random\n",
    "h3 = 0\n",
    "results = []\n",
    "trials = 10000\n",
    "trial = 0\n",
    "\n",
    "while trial < trials:\n",
    "    trial = trial + 1\n",
    "    result = ['H' if random.randint(0,1) == 1 else 'T',\n",
    "              'H' if random.randint(0,1) == 1 else 'T',\n",
    "              'H' if random.randint(0,1) == 1 else 'T']\n",
    "    results.append(result)\n",
    "    h3 = h3 + int(result == ['H','H','H'])\n",
    "    \n",
    "print (\"%.2f%%\" % ((h3/trials)*100))\n",
    "\n",
    "# print (results)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 概率树\n",
    "\n",
    "\n",
    "                         ____H(0.5)  : 0.5 x 0.5 x 0.5 = 0.125\n",
    "                        /\n",
    "                   ____H(0.5)\n",
    "                  /     \\____T(0.5)  : 0.5 x 0.5 x 0.5 = 0.125\n",
    "                 /        \n",
    "              __H(0.5)   ____H(0.5)  : 0.5 x 0.5 x 0.5 = 0.125\n",
    "             /   \\      / \n",
    "            /     \\____T(0.5)\n",
    "           /            \\____T(0.5)  : 0.5 x 0.5 x 0.5 = 0.125\n",
    "          /              \n",
    "    _____/              _____H(0.5)  : 0.5 x 0.5 x 0.5 = 0.125\n",
    "         \\             / \n",
    "          \\        ___H(0.5)\n",
    "           \\      /    \\_____T(0.5)  : 0.5 x 0.5 x 0.5 = 0.125\n",
    "            \\    /       \n",
    "             \\__T(0.5)  _____H(0.5)  : 0.5 x 0.5 x 0.5 = 0.125\n",
    "                 \\     /\n",
    "                  \\___T(0.5)\n",
    "                       \\_____T(0.5)  : 0.5 x 0.5 x 0.5 = 0.125\n",
    "                                                         _____\n",
    "                                                          1.0\n",
    "                        \n",
    "\n",
    "\n",
    "#### 交集和并集\n",
    "\n",
    "##### 交\n",
    "\n",
    "\\begin{equation}P(A \\cap B) = P(A) \\times P(B) \\end{equation}\n",
    "\n",
    "##### 并\n",
    "\n",
    "\\begin{equation}P(A \\cup B) = P(A) + P(B) - P(A \\cap B)\\end{equation}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 条件概率\n",
    "\n",
    "\\begin{equation}P(B|A) = \\frac{P(A \\cap B)}{P(A)}\\end{equation}\n",
    "\n",
    "或者\n",
    "\n",
    "\\begin{equation}P(A \\cap B) = P(A) \\times P(B|A)\\end{equation}\n",
    "\n",
    "\n",
    "### 互斥事件不独立\n",
    "\n",
    "\\begin{equation}P(A \\cap B) = 0\\end{equation}\n",
    "\n",
    "\n",
    "\\begin{equation}P(A \\cup B) = P(A) + P(B)\\end{equation}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "## 二项分布\n",
    "\n",
    "\n",
    "### 二项式系数记号${C^{k}_{n}}$ 或者 ${\\begin{pmatrix} n \\\\ k\\end{pmatrix}}$\n",
    "\n",
    "\n",
    "\\begin{equation}\\begin{pmatrix} n \\\\ k\\end{pmatrix} = \\frac{n!}{k!(n-k)!}\\end{equation}\n",
    "\n",
    "一枚硬币扔三次，求概率分布\n",
    "\n",
    "\\begin{equation}P(x=2) = \\frac{C^{2}_{3}}{8} =  \\frac{3!}{2!(3 - 2)!8} = \\frac{3}{8}\\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGNpJREFUeJzt3X+0XWWd3/H3x/BrKoogt3UKxATNVIMyoFfUsaJ2QIOMxFWkRusqjriysFKdxZpVsYy4jOMIaq0/hqlQpaUqDSjWyYxxISow43KQXATBQDOEyMhtGInCiFYHDH77x97Rw+Xm7pPcu++5JO/XWmedvZ/9PPt+2eHcz917n/OcVBWSJM3kcaMuQJK08BkWkqROhoUkqZNhIUnqZFhIkjoZFpKkToaFJKmTYSFJ6mRYSJI67TPqAubKoYceWkuWLBl1GZL0mHLjjTf+sKrGuvrtMWGxZMkSJiYmRl2GJD2mJPm7Yfp5GUqS1MmwkCR1MiwkSZ0MC0lSJ8NCktTJsJAkdTIsJEmdDAtJUifDQpLUaY/5BLdGa8k5Xxp1CSN11/knz2q8x292x0/988xCktTJsJAkdTIsJEmdDAtJUifDQpLUybCQJHUyLCRJnQwLSVInw0KS1KnXsEiyIsmmJJu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nAVe3UyItoplSBJppHT6b5IuMaAZb7T0MC4lmameaWTqvbX9pnw5s59eXag8Y6B6mn15+urlzApxaVZumtN+e5FvAycBVSd5cVV9vQ+uVwPuTfAX438DGqnrhNPs+mebb+U4B3pXkqGq+Q0Gac96z0F4vyb9Ismyg6Rjg74C7+PUUzqcObP8KzYR2O8YfTHOm8JIkS9u2HZehrgL+w8BMqce2z0cCW6rqYzQzlR6d5J8DP6uqzwAfovmK1k3AWHsTniT7tvc7HgccUVXXAP8ReBJw4FwcD2k6TiSovV771/zHaX7hbqeZMXQ18EyaKbN/QPONbeNV9dI0X85zIU2QPAy8p6q+kOQk4E9o/gi7t6pObKeK/gjNDMcB7qqq30vyTuANNDPU/j3Nl289D/gg8Mu2/S1VNZHkGOBjNN+NsE+7v/9BM2voQe1+P1NV5/d3lLS3MywkSZ28DCVJ6mRYSJI6GRaSpE6GhSSpk2EhSepkWEiSOhkWkqROhoUkqdP/B71JW9f5fuCdAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from scipy import special as sps\n",
    "\n",
    "trials = 3\n",
    "\n",
    "possibilities = 2**trials\n",
    "x = np.array(range(0, trials+1))\n",
    "\n",
    "p = np.array([sps.comb(trials, i, exact=True)/possibilities for i in x])\n",
    "\n",
    "plt.xlabel('Successes')\n",
    "plt.ylabel('Probability')\n",
    "plt.bar(x, p)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 假设事件发生的概率不是${\\frac{1}{2}}$ （有偏）\n",
    "\n",
    "可以把二项式分布记为：\n",
    "\n",
    "\\begin{equation}P(x=k)  = \\begin{pmatrix} n \\\\ k\\end{pmatrix}p^{k}(1-p)^{(n-k)}\\end{equation}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFn5JREFUeJzt3X+QXeV93/H3xyKAi38Em53a1Y9ItuUmwk4hWcudMiGNA0aOEsQ0di1ct7gho5JBNRmaqUXj4IlsGkwS4rSj1Ki2ZqhdKpOQZrZGKcU1OPU42Lsy2FSiqheZmI2cohhiILYBwbd/3CPnsuzuuZL26K5W79fMzj3nOc9z9nuGYT86P+5zUlVIkjSXFw27AEnSwmdYSJJaGRaSpFaGhSSplWEhSWplWEiSWhkWkqRWhoUkqZVhIUlqdcqwC5gvZ511Vq1cuXLYZUjSCWX37t1/WVUjbf0WTVisXLmSiYmJYZchSSeUJH82SD8vQ0mSWhkWkqRWhoUkqVWnYZFkXZJ9SSaTbJmj39uTVJLRvrZrmnH7klzUZZ2SpLl1doM7yRJgG3AhMAWMJxmrqr3T+r0UeC/wxb62NcBG4Gzg7wCfSfL6qnq2q3olSbPr8sxiLTBZVfur6mlgJ7Bhhn4fBG4AvtfXtgHYWVVPVdXXgclmf5KkIegyLJYCD/etTzVt35fkXGB5VX36SMc24zclmUgycfDgwfmpWpL0Al2GRWZo+/47XJO8CPgd4F8d6djvN1Rtr6rRqhodGWn9Tokk6Sh1+aW8KWB53/oy4EDf+kuBNwB3JwF4FTCW5OIBxkqSjqMuw2IcWJ1kFfDn9G5Yv+vwxqr6NnDW4fUkdwO/UlUTSb4L3JLkRno3uFcDX+qw1kVn5Zbbh13CQB66fv2wS5A0gM7CoqoOJdkM3AEsAXZU1Z4kW4GJqhqbY+yeJLcCe4FDwJU+CSVJw9Pp3FBVtQvYNa3t2ln6/sN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fXuIZd1TJKc0TxQQZIzgLcCJ8wThobFPKuqQ8DhaU4eAG6tqj3DrerYJPkvwJ8CfzfJVJLLh13TMToP+Kf0/rV6X/PzM8Mu6hi9GrgryVfp/YPlzqpaFI+bLiJ/G/h8kq/Qm+vu9qr670OuaWA+OitJauWZhSSplWEhSWplWEiSWhkWkqRWhoUkqZVhIUlqZVhIkloZFlJHkrwpyVebd02c0bxn4oSdr0knN7+UJ3UoyYeA04EXA1NV9RtDLkk6KoaF1KFmfrBx4HvAP6iqZ4dcknRUvAwldesVwEuAl9I7w5BOSJ5ZSB1KMkZviu1V9F7lunnIJUlH5ZRhFyAtVkn+GXCoqm5p3s3+hSRvqarPDrs26Uh5ZiFJauU9C0lSK8NCktTKsJAktTIsJEmtDAtJUivDQpLUyrCQJLUyLCRJrf4/bym/GmvKdyYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from scipy.stats import binom\n",
    "\n",
    "\n",
    "n = 5\n",
    "p = 0.25\n",
    "x = np.array(range(0, n+1))\n",
    "\n",
    "prob = np.array([binom.pmf(k, n, p) for k in x])\n",
    "\n",
    "\n",
    "plt.xlabel('x')\n",
    "plt.ylabel('Probability')\n",
    "plt.bar(x, prob)            # 可以在图中看到偏离的情况\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAE41JREFUeJzt3X+0XeVd5/H3p4n8KLXQ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Z7rqkp8Ob8qQBJbkUOAI4km7spl9b5pKkp8WwkAbUjzd2O/AE8L1V9ZVlLkl6WuyGkob1fOA5wNfTHWFIhySPLKQBJdlON6jdeuCbq+qCZS5JelpWt5tIejqSvBHYX1X/rX/W+/9OckpV3bLctUkHyiMLSVKT5ywkSU2GhSSpybCQJDUZFpKkJsNCktRkWEiSmgwLSVKTYSFJavonUOOZ0K++Nb0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "n = 100\n",
    "p = 0.25\n",
    "x = np.array(range(0, n+1))\n",
    "\n",
    "prob = np.array([binom.pmf(k, n, p) for k in x])\n",
    "\n",
    "\n",
    "plt.xlabel('x')\n",
    "plt.ylabel('Probability')\n",
    "plt.bar(x, prob)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 二项式分布的统计特征 （期望和方差）\n",
    "\n",
    "\\begin{equation}\\mu  = np\\end{equation}\n",
    "\n",
    "\\begin{equation}\\mu  = 100 \\times 0.25 = 25\\end{equation}\n",
    "\n",
    "\\begin{equation}\\sigma^{2}  = np(1-p)\\end{equation}\n",
    "\n",
    "\\begin{equation}\\sigma  = \\sqrt{np(1-p)}\\end{equation}\n",
    "\n",
    "\\begin{equation}\\sigma  = \\sqrt{18.75} \\approx 4.33 \\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "25.0\n",
      "18.75\n",
      "4.330127018922194\n"
     ]
    }
   ],
   "source": [
    "from scipy.stats import binom\n",
    "\n",
    "n = 100\n",
    "p = 0.25\n",
    "\n",
    "print(binom.mean(n,p))\n",
    "print(binom.var(n,p))\n",
    "print(binom.std(n,p))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# 采样和分布\n",
    "\n",
    "\n",
    "\\begin{equation}\\mu_{\\hat{p}} = \\hat{p}\\end{equation}\n",
    "\n",
    "\\begin{equation}\\sigma_{\\hat{p}} = \\sqrt{\\hat{p}(1-\\hat{p})}\\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAEuxJREFUeJzt3X+Ub3Vd7/HnSw6GKArFWKbY0ZZSRP7AsTRuoQItQoN+UOLSEjPoh6aW3Svm7erq6rpQpmlaelICEY1QMxIJSEWqJeggv3+opIQnKMYsSSERfN8/9j40nM45s8/MfPdmzuf5WGvW2XvP/u7P+zMzZ17z2Xt/PztVhSSpXfebugBJ0rQMAklqnEEgSY0zCCSpcQaBJDXOIJCkxhkEktQ4g0CSGmcQSFLjNkxdwBD77rtvbdy4ceoyJGldufTSS79UVXPL7bcugmDjxo0sLCxMXYYkrStJ/nHIfp4akqTGGQSS1DiDQJIaZxBIUuMMAklqnEEgSY0zCCSpcQaBJDXOIJCkxq2LdxavxsYTz5ms7RtPeuZkbUvSUI4IJKlxBoEkNc4gkKTGGQSS1DiDQJIaZxBIUuMMAklqnEEgSY0zCCSpcQaBJDXOIJCkxs0sCJKckuTWJFcv2fZ7Sa5PcmWSv0iy96zalyQNM8sRwanAEVttuwA4sKoeB3wWeOUM25ckDTCzIKiqi4Avb7Xt/Kq6q1+9GHjErNqXJA0z5TWCXwD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PTrIX8PfAG5KcQRdWm7Oyx2NcBbw+ycnAh6rqb1dyELXNINC60v/ivpBuhtGr6CYSvBS4pqqeuo2XnAr8RFVd0Z9medqSz31tyXLY9rS+31gyj83dbP//zJlV9eL+OsY5Sc6tqn+mG3U/taq2/ov/pCTn0M0fc3E/S+xd3HuUvsd22rpHVX22D8cjgf+X5Pyq+p3lXict5akhrRtJ9k+ydIrlJwD/SDf18lz/S5gkuyf5vn6fvYBb+tNHz93B4c8HXrykrX1WUmM/LfLpwEu3c9wn9P9+d1VdVVUn041ovqfvywHpnq/9EPoZNrfhG31/SPKdwO1V9W7g9XSPO5R2ikGg9eRBwGnpHtR+Jd3zal/TP9LwGLqLvlcAlwM/1L/mt4FLgAuA63dw7NcC+/QXXK+gn9p5hU4GXtCfAnoJMN9fgL4W+OV+n5ctaesO4Nyq+iLdPPtXAmfQPYt4WzYBV/anlb4f+GSSy+meO/HaVdStRjn7qCQ1zhGBJDXOIJCkxhkEktQ4g0CSGmcQSFLjDAJJapxBIEmNMwgkqXH/H+SfKH/8w6xyAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Mean: 0.1875\n",
      "StDev: 0.3903123748998999\n"
     ]
    }
   ],
   "source": [
    "searches = np.array([0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0])\n",
    "\n",
    "plt.xlabel('Search Results')\n",
    "plt.ylabel('Frequency')\n",
    "plt.hist(searches)\n",
    "plt.show()\n",
    "print('Mean: ' + str(np.mean(searches)))\n",
    "print('StDev: ' + str(np.std(searches)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 对数据\n",
    "\n",
    "| Sample | Result |\n",
    "|--------|--------|\n",
    "| p&#770;<sub>1</sub>| 0.1875 |\n",
    "| p&#770;<sub>2</sub>| 0.2500 |\n",
    "| p&#770;<sub>3</sub>| 0.3125 |\n",
    "| p&#770;<sub>4</sub>| 0.1875 |\n",
    "| p&#770;<sub>5</sub>| 0.1250 |\n",
    "| p&#770;<sub>6</sub>| 0.3750 |\n",
    "| p&#770;<sub>7</sub>| 0.2500 |\n",
    "| p&#770;<sub>8</sub>| 0.1875 |\n",
    "| p&#770;<sub>9</sub>| 0.3125 |\n",
    "| p&#770;<sub>10</sub>| 0.2500 |\n",
    "| p&#770;<sub>11</sub>| 0.2500 |\n",
    "| p&#770;<sub>12</sub>| 0.3125 |"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFo5JREFUeJzt3X2QZXV95/H3x2EEFSMovSsL0zZGYgKEx5b1YV0RsYKokKy44ppEXGVWCwrduLUBTdBQWgtbrsQENmQMLogmoOhaIw9BWMSHrQUZcBiedUCyTGDjCMo4guDgd/+4Z47Xth9uT/fpO93zflWdmnPO/Z1zvr+5M/3p83B/N1WFJEkATxt2AZKk7YehIElqGQqSpJahIElqGQqSpJahIElqGQqSpJahIElqGQqSpNZOwy5gtvbYY48aGxsbdhmStKjcfPPNP6iqkZnaLbpQGBsbY82aNcMuQ5IWlST/MEg7Lx9JklqGgiSpZShIklqGgiSpZShIklqdh0KSZUm+neTySV7bOcmlSdYnuTHJWNf1SJKmthBnCu8F7pritXcCP6yqFwHnAGcvQD2SpCl0GgpJ9gZeD/zNFE2OAy5q5i8DXpMkXdYkSZpa12cKfw78Z+DnU7y+F/AAQFVtA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piswySiwC7CuWfUJ4Jyqegm9T8D+TbP+PwEnN2cXrwQeH+QvoKpOAx6vqoOr6m30hiF/sKoOqqoDgL8fZD9SP0dJ1aJUVZub0ShfSe8Lbi5tvilrDXAAcE0S6H1xykPNZgck+QiwG7ArcHXfLj9fVU8180cBJ/Qd64fN7JPA1t/ebwZeO0V5b0nyauDFwElV9dO+/e7X1AXwa0meDfxv4ONJPksvuDb0tZmN24CPJTkbuLyqvrEtO9GOzVDQotX8EL8euD7JbfSGML6Z3vhSL5tkkwuB362qW5tLMUf0vfaTvvkw+VDPP6tfjAvzFFP//7m0qk5p7ntckeSqqvp/9M7MX1ZVE88EzkpyBb1xd25oRlvdwi+fye8yxbFaVfWdJiiPAf5Lkq9U1ZkzbSf18/KRFqUkL06yb9+qg4F/oDcA20jzA5kky5Ps37R5NvBQc4npbdPs/ivAKX3H2n1baqyq/wNcDLx3iv0e3Pz561V1W1WdTe9M5zebvuyXZOckzwFeM8Vhftb0hyT/Anisqj4DfAw4dFvq1o7NUNBitStwUZI7k6yj973AH67e1ygeT++G8a30RrN8ebPNnwI30vsa0Lun2fdHgN2bm7W30rs8ta3OBt7RXCY6FRhvbl7fCby7afO+vmM9DlxVVQ8An6N3P+KzwLen2P8qYF1z6em3gW8lWUtvlNKPzKFu7aAcJVWS1PJMQZLUMhQkSS1DQZLUMhQkSS1DQZLUMhQkSS1DQZLUMhQkSa3/DwfUHawe1QHKAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "searches = np.array([0.1875,0.25,0.3125,0.1875,0.125,0.375,0.25,0.1875,0.3125,0.25,0.25,0.3125])\n",
    "\n",
    "\n",
    "plt.xlabel('Search Results')\n",
    "plt.ylabel('Frequency')\n",
    "plt.hist(searches)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "#### 中心极限定理\n",
    "\n",
    "对于很多样本数的情况，二项式分布趋近于正态分布。\n",
    "\n",
    "再看一个例子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEICAYAAABI7RO5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGt1JREFUeJzt3XuUJWV97vHvA14QwQCHweCADJoxEVwRyQCuo4kaDTclaKIGY3QkJMQEjsmJZyV4iRAN55CL10g0GIl4JRg1TgSFgYiXc4IwKnIRkREQhkEYAQEBL5Df+aPehk1PT/eu6d69u5nvZ629du233qr6dfXMfnbVW107VYUkScPaatwFSJIWF4NDktSLwSFJ6sXgkCT1YnBIknoxOCRJvRgcul+Slyc5Z0Tr/kCSvxrFuqfY1quSfHk+tjUbSc5P8nttemT7fsha3pvkL+ZoXY9P8sMkW7fX9/+cc7T+zyZZOVfrU38GxxYmyTOT/L8ktye5Ncn/TbIfQFV9pKoOXAA1zukbzRTrPyrJt5LcmeSmJGcm2X5U2xvGKPd9kmuT3NN+3h+03/+rk9z//7+qXl1VbxlyXc+brk9VXVdV21XVfXNQ+wlJPjxp/YdU1WmzXbc2n8GxBUnyGOAzwN8DOwFLgb8EfjzOuuZTkmcB/xt4WVVtDzwZOGO8Vc2Lw9rPuwdwEvDnwPvneiNJHjbX69TCY3BsWZ4EUFUfq6r7quqeqjqnqi6BjU/xJKkkf5TkqvZp9S1JnpjkP5PckeSMJI+YatmB5X9uchFJdkzymSQbktzWpndr804Efhl4dzvd8e7W/gtJVrejpCuTvHRgff8tyapW04XAE6fZB/sB/1lVX2/74taqOq2q7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ls6l4E+/sxA9O/DnyuTe/V+j8S2LOtZ+tFUPcy4LKFur9bv+2BLwIXACvGvb9nenjE8WD339qkqn4CTNza5H5VdW1VXQL816RlDwJWV9WtVXUbsBo4eD6KbmZT+zgNU/fnq+ru9vICur/jgfHu89nUPU7D1H3HwMtH88Af2x4OnF5VP66qa4C1bX3zYTZ1j9OMdTdvAf4G+NFA2zj397QMjgeb6tYmS+dh2bkw2+1vk2RNkguSvHBuS5tW37qPAj67mcvOpdnUDQt8fyc5Jsl36N7MXtNn2RGZTd0Aeyb5epIvJPnl0Zb6IDPWneRpwO5V9Zm+y47Lovg7jnk0461NRrTsXJjt9h9fVeuTPAH4jySXVtV35qi26Qxdd5LfAVYAz+q77AjMpm5Y4Pu7qk4GTk7y28AbgZXDLjsis6n7Rrr9fUuSXwL+Lcnek45QRmXaupNsBbwdeFXfZcfJI44Hm82tTcZ9W5RZbb+q1rfnq4HzgafNZXHTGKruJM8D3gD8elX9uM+yIzKbuhf8/h5wOjBxRLTg9/eA++tup3puadNfpRsreNKI6pxsprq3B54CnJ/kWuDpwKo2QD7u95RNG/cgy0J60B2BXU03EDUxkLX3Jvp+gI0Hx6+hG6TdsU3vtEhq3xF4ZJveGbiKKQbwxlU33Zvqd4Dlk9rHts9nWfdC39/LB6YPA9a06b158GDt1czf4Phs6l4yUSfdIPUNC+nfyaT+5/PA4PjY9veMP9e4C1hoD+BQ4NvtP/wbWtub6T4xAuxH90ngLuAW4PKBZX+XbgBrLXDkYqkd+O/Ape0f6aXAUQus7nOBm4CL22PVQtjnm1v3Itjf7wQubzV/fvCNju7o6TvAlcAhi6Fu4Ddb+zeArwGHLaS6J/U9nxYc497f0z285YgkqRfHOCRJvRgckqReDA5JUi8GhySpF4NDktSLwSFJ6sXgkCT18v8BwwQ9L2lteiwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Mean: 0.24929500000000002\n",
      "Std: 0.042734945917366686\n"
     ]
    }
   ],
   "source": [
    "n, p, s = 100, 0.25, 10000\n",
    "df = pd.DataFrame(np.random.binomial(n,p,s)/n, columns=['p-hat'])\n",
    "\n",
    "means = df['p-hat']\n",
    "means.plot.hist(title='Simulated Sampling Distribution')  \n",
    "plt.show()\n",
    "print ('Mean: ' + str(means.mean()))\n",
    "print ('Std: ' + str(means.std()))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 样本的均值和方差\n",
    "\n",
    "\n",
    "\\begin{equation}\\sigma_{\\hat{p}} = \\sqrt{\\frac{p(1-p)}{n}}\\end{equation}\n",
    "\n",
    "把样本数从16增加为100\n",
    "\n",
    "\\begin{equation}\\sigma_{\\hat{p}} = \\sqrt{\\frac{0.25 \\times 0.75}{16}} \\approx 0.11\\end{equation}\n",
    "\n",
    "\\begin{equation}\\sigma_{\\hat{p}} = \\sqrt{\\frac{0.25 \\times 0.75}{100}} \\approx 0.043\\end{equation}\n",
    "\n",
    "有了均值和方差，就可以应用百分之六十八九十五和九十九\n",
    "\n",
    "比如95.4%的样本都会在范围0.25 &plusmn; 0.086内， 称为置信区间。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEICAYAAABI7RO5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XuYHVWZ7/Hvj4siAhIO4RYC4RIdIcglDfgcccSDkgCJ6HgjcSRBBC9E4ch5hoCMoBwxmVEEgRHDiA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BZBn8BeAp4J6GZT9F1vHUDhw32PYB+O/AslTJlgHHt/A+/ApYDSxJj7mD8Dh0uw+D7DhcANyT4r+p8cOM7EzqQbLbHBxR1T70Zz+AD6fypcBdwMRW3YdGhEulAAAAPklEQVQu895MShxFHwtfcsTMzHJxH4eZmeXixGFmZrk4cZiZWS5OHGZmlosTh5mZ5eLEYWZmuThxmJlZLv8f30Oz3OAuuOoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "n, p, s = 100, 0.25, 10000\n",
    "df = pd.DataFrame(np.random.binomial(n,p,s)/n, columns=['p-hat'])\n",
    "\n",
    "means = df['p-hat']\n",
    "m = means.mean()\n",
    "sd = means.std()\n",
    "moe1 = m - (sd * 2)\n",
    "moe2 = m + (sd * 2)\n",
    "\n",
    "means.plot.hist(title='Simulated Sampling Distribution')  \n",
    "\n",
    "plt.axvline(m, color='red', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(moe1, color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(moe2, color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "### 用样本均值生成样本分布\n",
    "\n",
    "下例展示多个随机变量组合的效果\n",
    "\n",
    "| Sample | Weights |\n",
    "|--------|---------|\n",
    "| 1      | [4.020992,2.143457,2.260409,2.339641,4.699211] |\n",
    "| 2      | [3.38532,4.438345,3.170228,3.499913,4.489557] |\n",
    "| 3      | [3.338228,1.825221,3.53633,3.507952,2.698669] |\n",
    "| 4      | [2.992756,3.292431,3.38148,3.479455,3.051273] |\n",
    "| 5      | [2.969977,3.869029,4.149342,2.785682,3.03557] |\n",
    "| 6      | [3.138055,2.535442,3.530052,3.029846,2.881217] |\n",
    "| 7      | [1.596558,1.486385,3.122378,3.684084,3.501813] |\n",
    "| 8      | [2.997384,3.818661,3.118434,3.455269,3.026508] |\n",
    "| 9      | [4.078268,2.283018,3.606384,4.555053,3.344701] |\n",
    "| 10     | [2.532509,3.064274,3.32908,2.981303,3.915995] |\n",
    "| 11     | [4.078268,2.283018,3.606384,4.555053,3.344701] |\n",
    "| 12     | [2.532509,3.064274,3.32908,2.981303,3.915995] |\n",
    "\n",
    "计算均值：\n",
    "\n",
    "| Sample | Mean Weight |\n",
    "|--------|---------|\n",
    "| x&#772;<sub>1</sub> | 3.092742  |\n",
    "| x&#772;<sub>2</sub> | 3.7966726 |\n",
    "| x&#772;<sub>3</sub> | 2.98128   |\n",
    "| x&#772;<sub>4</sub> | 3.239479  |\n",
    "| x&#772;<sub>5</sub> | 3.36192   |\n",
    "| x&#772;<sub>6</sub> | 3.0229224 |\n",
    "| x&#772;<sub>7</sub> | 2.6782436 |\n",
    "| x&#772;<sub>8</sub> | 3.2832512 |\n",
    "| x&#772;<sub>9</sub> | 3.5734848 |\n",
    "| x&#772;<sub>10</sub> | 3.1646322 |\n",
    "| x&#772;<sub>11</sub> | 3.5734848 |\n",
    "| x&#772;<sub>12</sub> | 3.1646322 |"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFW5JREFUeJzt3XmwZnV95/H3h+5WQBAy6U5kgOZqxIUwsrUEl8wQlwxiApURI8zEKGXsKZcoE5MSSQoJqVTpkJEJgQSagWKJcUNCWsWhYKIiKEuDbE3DpIOMdKBCi4ZFENL4nT/O6ZMnl9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fwnNU+qTfQt4bbutn9CMTzMaCte2p5P+DDimqg4Bzgf+eHQjbc3nAG+pqtfTvF9j1CtoBlA8FPh4u80Tgb+vqgOr6veA/wxc0Q6gdgDNYIvSVnOYCy0IVXVbmmHKj6MZRnjULwNHjZyb35FmyJH7aUanPZBmCISXjXznhqraANBeO5gArpm03Wtphhr4JnBjVf19kpcmWUbzgpR72pEt9weubA82FgEPTNrOK4B72gHboDnKWTmy/ivt4HtPJnkQ+Nkp/hfcCJzfBsZlVWUoaFYMBS0kq4E/oRkmefT9DQHeVlV3jzZOcgrwjzS/We/Av365zOgIqE8z9d+V64BXA68Hvt0u20Az1tO3Rva9tqpeM03dM72AaMZaqurqJP+e5hTaxUlOq6qLZtiu9AyePtJCcj5walXdPmn5FcBvb74u0I52Cs2Q3g+01wfeSfNbfG/tW/XuA97Nv4TCt2lOO20OhbuBZUle0+57SZKfn7Spu4CX5F/eZf2OHrt/lGbIa9rt7gM8WFXn0gxIePDW9EXazFDQglFVG6rqT6dY9Uc0rzO8Lckd7TzAnwPvSnIdzamjH81it9cCz6+q+9r5b9Ncg/hWW9NTNMOHfzLJrTTn+l87uoGqeoLmTqL/neQamqOXh6fbaTvS57XtReXTaI6ObknyHeBtwFT/H6QZOUqq9CyQZJeqeqw9mjkL+LuqOn3cdem5xyMF6dnhve0F7bU0p7XOGXM9eo7ySEGS1PFIQZLUMRQkSR1DQZLUMRQkSR1DQZLUMRQkSZ3/DwAOW45vpNiRAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Mean: 3.2443954\n",
      "Std: 0.2903283632058937\n"
     ]
    }
   ],
   "source": [
    "\n",
    "meanweights = np.array([3.092742,\n",
    "                        3.7966726,\n",
    "                        2.98128,\n",
    "                        3.239479,\n",
    "                        3.36192,\n",
    "                        3.0229224,\n",
    "                        2.6782436,\n",
    "                        3.2832512,\n",
    "                        3.5734848,\n",
    "                        3.1646322,\n",
    "                        3.5734848,\n",
    "                        3.1646322])\n",
    "\n",
    "plt.xlabel('Mean Weights')\n",
    "plt.ylabel('Frequency')\n",
    "plt.hist(meanweights, bins=6)\n",
    "plt.show()\n",
    "\n",
    "print('Mean: ' + str(meanweights.mean()))\n",
    "print('Std: ' + str(meanweights.std()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEICAYAAABF82P+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAHFVJREFUeJzt3XmUXHWd9/H3h4AEZEkwASELDRgcljMs0yznQccFhkXA4AgYxsEAkQwKD+MjzxkRGBYZZnBUtsERwgAGVCCIDpFFCAgi80his4WwSYRIYjAJEAi7JnyfP+6v4dK51X27U7frdvfndU6duvd3l/r2r7rqW7+lbikiMDMz62qtVgdgZmb15ARhZmaFnCDMzKyQE4SZmRVygjAzs0JOEGZmVsgJYgiS9HlJt1d07u9L+pcqzl3wWEdJurc/HmtNSLpb0hfTcmV1XzKWSyT9c5PONV7Sq5KGpfV3/s4mnf9WSZObdT7rPSeIQUrSRyT9P0kvS3pR0v9I2g0gIn4YEfvWIMamvqEUnH+KpCckvSJpiaSbJW1Y1eOVUWXdS1og6Y30976Unv/jJL3zOo+I4yLi7JLn2qe7fSLi2YjYICJWNSH2MyX9oMv5D4iI6Wt6bus7J4hBSNJGwE3AfwCbAGOAs4C3WhlXf5L0MeBfgSMiYkNgO2BGa6PqFwenv3dL4Fzga8DlzX4QSWs3+5xWP04Qg9O2ABFxTUSsiog3IuL2iJgLq3fNS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ro7ZnG6fzodu0t/xyZpH+BU4NMR8VYqrkW9NYitFvWWcy3Q2YqpRb0VxVaD1+mGwI7A3ZIWAHsCM9NAddPrbcAlCEmjJY1Iy+sB+wBPdNltJtA5Y+RQ4BcREal8krKZRFsBE4A5dYgtHTssHbt1iu3pfo6tkduAfSWNlDQS2DeVtTy2FNO6aXkUsBdNvDx8mdhSk/9SsjfgpblNLa+3RrHVpN4m5FYPBJ5Kyy1/nTaKrdWv04h4OSJGRURbRLSRjSt9OiI6qKLeoqLR+KpuZDNZHgTmAvOA01P5N1JFAQwHricbpJkDbJ07/lSyrP8kcEBdYgM+CzxKNgvhAeDgFsS2G9mnkNeAF4BHc8cfk2KeDxxdl9iA/wU8kurtEWBKC2K7A1gCPJRuM2tUb4Wx1aTeLkz/8w8BdwE75I5v9eu0MLY6vE677H83aRZTFfXmS22YmVmhAdfFZGZm/cMJwszMCjlBmJlZIScIMzMr5ARhZmaFnCDMzKyQE4SZmRX6/5VrvWUhD98jAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sample Mean: 3.200047484836999\n",
      "Sample StdDev: 1.1998703000813948\n",
      "Sampling Mean: 3.200047484836996\n",
      "Sampling StdErr: 0.052796653060840436\n"
     ]
    }
   ],
   "source": [
    "mu, sigma, n = 3.2, 1.2, 500\n",
    "samples = list(range(0, 10000))   # 比较久运行时间，几分钟\n",
    "\n",
    "data = np.array([])\n",
    "\n",
    "sampling = np.array([])\n",
    "\n",
    "for s in samples:\n",
    "    sample = np.random.normal(mu, sigma, n)\n",
    "    data = np.append(data,sample)\n",
    "    sampling = np.append(sampling,sample.mean())\n",
    "\n",
    "df = pd.DataFrame(sampling, columns=['mean'])\n",
    "\n",
    "means = df['mean']\n",
    "means.plot.hist(title='Simulated Sampling Distribution', bins=100)  \n",
    "plt.show()\n",
    "\n",
    "print('Sample Mean: ' + str(data.mean()))\n",
    "print('Sample StdDev: ' + str(data.std()))\n",
    "print ('Sampling Mean: ' + str(means.mean()))\n",
    "print ('Sampling StdErr: ' + str(means.std()))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 置信区间\n",
    "\n",
    "\n",
    "\n",
    "| 置信度  | 标准分数 |\n",
    "|-------------|---------|\n",
    "| 90%         | 1.645   |\n",
    "| 95%         | 1.96    |\n",
    "| 99%         | 2.576   |\n",
    "\n",
    "\n",
    "\n",
    "\\begin{equation}MoE = 0.053 \\times 1.96 = 0.10388 \\end{equation}\n",
    "\n",
    "当样本趋近无限大时，辨准差会趋近0\n",
    "\n",
    "\\begin{equation}\\lim_{n \\to \\infty} \\frac{\\sigma}{\\sqrt{n}} = 0\\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEICAYAAABF82P+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XmYXGWZ9/Hvj4AsAgIStpDQEKIjRAnQLNegMyqMCRpER0SCowGRuBCFV95rWGQAddhGZREcIYgSUVaXMQRMWATReYWYQELCJgEixIQQIeyLEu/3j/M0FJ3T3dVVfeqc6v59rquuOnXqnFN3P/1U3fUsdY4iAjMzs+7WKjsAMzOrJicIMzPL5QRhZma5nCDMzCyXE4SZmeVygjAzs1xOEEOQpE9KuqGgY18q6T+LOHbOax0m6XeteK1mSLpV0mfTcmFlX2csF0r6jwE61ihJz0salh6/9ncO0PF/JWnyQB3P+s8JYpCS9G5J/0/SM5KekvS/kvYAiIifRMQHKh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ewCDg5rf96KkCA9YBryAZv5gA71Oz/VbJvAg8A+1clNuBjwD1ksxPuBA5ocVx7kH0zeQF4ErinZv/PpHgXA4dXIS7gH4GFqbwWAke0OK6bgBXA/HSbUZHyyo2ryPLqR2znpTo+H7gF2Llm/0Lel83EVfZ7stv2t5JmMRVZXj7VhpmZ5Wr7LiYzMyuGE4SZmeVygjAzs1xOEGZmlssJwszMcjlBmJlZLicIMzPL9f8BgNIHnR1iCJkAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sampling Mean: 3.2004775949381727\n",
      "Sampling StdErr: 0.05400806134243375\n",
      "95% Confidence Interval: (3.0946237398321728, 3.3063314500441727)\n"
     ]
    }
   ],
   "source": [
    "mu, sigma, n = 3.2, 1.2, 500\n",
    "samples = list(range(0, 10000))\n",
    "\n",
    "data = np.array([])\n",
    "\n",
    "sampling = np.array([])\n",
    "\n",
    "\n",
    "for s in samples:\n",
    "    sample = np.random.normal(mu, sigma, n)\n",
    "    data = np.append(data,sample)\n",
    "    sampling = np.append(sampling,sample.mean())\n",
    "\n",
    "df = pd.DataFrame(sampling, columns=['mean'])\n",
    "\n",
    "means = df['mean']\n",
    "m = means.mean()\n",
    "sd = means.std()\n",
    "ci = stats.norm.interval(0.95, m, sd)\n",
    "\n",
    "means.plot.hist(title='Simulated Sampling Distribution', bins=100) \n",
    "plt.axvline(m, color='red', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(ci[0], color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(ci[1], color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.show()\n",
    "\n",
    "print ('Sampling Mean: ' + str(m))\n",
    "print ('Sampling StdErr: ' + str(sd))\n",
    "print ('95% Confidence Interval: ' + str(ci))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "# 假设检验"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "## 单样本单侧测试\n",
    "\n",
    "让学生对老师的授课打分，从-5 到 5.\n",
    "\n",
    "生成50个随机样本："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Min:-5\n",
      "Max:5\n",
      "Mean:0.84\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAADClJREFUeJzt3W+IZfV9x/H3p25CamIwxUnTuk7HliANNpAyhLRCE9wYtlnRPugDLQbbCPOkTbVE7FopeWpIyR9IISzGKkRMizEkxDR1myZIwUh3V000a/6Qbs0a0x0RmpQ+sEu+fbBX2G52d+bec+5c9zvvF8jMPffMnO9BePPbc++5k6pCknTu+4VFDyBJGodBl6QmDLokNWHQJakJgy5JTRh0SWrCoEtSEwZdkpow6JLUxI6tPNhFF11UKysrW3lISTrnHTx48IWqWtpovy0N+srKCgcOHNjKQ0rSOS/Jf2xmPy+5SFITBl2SmjDoktSEQZekJgy6JDWxYdCT3J3kWJKnTvPcrUkqyUXzGU+StFmbWaHfA+w+dWOSS4CrgGdHnkmSNIMNg15VjwAvnuapjwG3Af4NO0l6BZjpGnqSa4DnqurJkeeRJM1o6jtFk5wP3AG8Z5P7rwFrAMvLy9MeTtoSK3sfWtixj9y5Z2HHVi+zrNB/A7gUeDLJEWAncCjJm063c1Xtq6rVqlpdWtrwowgkSTOaeoVe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ai+TvbOVfVFyb73MGJf6Lft5WzbaFNfYRFR0leB3wOuKWqfrLoeeYlydXAsao6mORdi55nngz6RFW9+3Tbk/wWcCnwZBI4cenhUJK3V9WPt3DE0Z3pnF+W5EbgamBX9X1/66Y+wqKbJK/iRMzvq6oHFz3PnF0BXJPkvcBrgNcn+UxV3bDguUbn+9CnlOQIsFpVrT/IKclu4KPAO6tqfdHzzEuSHZx40XcX8BwnPtLijzrf9ZwTK5N7gRer6pZFz7OVJiv0W6vq6kXPMg9eQ9eZfBK4ANif5Ikkn1r0QPMweeH35Y+wOAz8Q+eYT1wBvA+4cvL/9onJ6lXnOFfoktSEK3RJasKgS1ITBl2SmjDoktSEQZekJgy6JDVh0CWpCYMuSU38H6rAkXo78D1nAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "\n",
    "np.random.seed(123)\n",
    "lo = np.random.randint(-5, -1, 6)\n",
    "mid = np.random.randint(0, 3, 38)\n",
    "hi = np.random.randint(4, 6, 6)\n",
    "sample = np.append(lo,np.append(mid, hi))\n",
    "print(\"Min:\" + str(sample.min()))\n",
    "print(\"Max:\" + str(sample.max()))\n",
    "print(\"Mean:\" + str(sample.mean()))\n",
    "\n",
    "plt.hist(sample)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "看起来评价是正面的，怎么知道这代表了全体同学的意见呢？\n",
    "\n",
    "我们把假设分成正面和负面两个\n",
    "\n",
    "\n",
    "\\begin{equation}H_{0}: \\mu \\le 0 \\\\ H_{1}: \\mu > 0 \\end{equation}\n",
    "\n",
    "假设 ${H_{0}}$ 是正确的，看看它的t检验是否落在置信区间里。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {
    "scrolled": false,
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFatJREFUeJzt3X+s3fV93/Hnq5Qk1ZINMpyM2mZG4EohZIX0ykbijzFIwVCnFNRIGC2xMjR3EkYgpVts+gdtMsDV1kACKZtbvJAtwFADwrgurkuDqvzBD5MSwBDGDfHCBReckZBE0Zig7/1xv24OcH3vuefce7733u/zIR2dc97n8z3n/ZXhvM/nx/dzU1VIkrrnF9pOQJLUDguAJHWUBUCSOsoCIEkdZQGQpI6yAEhSR1kAJKmjLACS1FEWAEnqqF9sO4HpHHfccbVq1aq205Cm8Fhz/2utZiFN5bHHHvtBVS2bqd2CLgCrVq1i3759bachTSHNvf99auFJ8r/7aecQkCR1lAVAkjrKAiBJHWUBkKSOWtCTwNLC5d/R0OJnD0CSOsoCIEkdZQGQBvJreBGYFjvnAKSBfKvtBKSh2QOQhrBqy5+zasuft52GNBALgCR11IwFIMl7kjyS5NtJ9if5gyb+lSTfS/J4czutiSfJl5KMJ3kiyUd73mtjkuea28b5Oy1p7hz+le8vfS01/cwBvA6cXVU/TXI08M0kf9G89u+r6s/e1v58YHVzWwvcAqxN8n7gGmCMyUXUjyXZWVU/nIsTkSTNzowFoKoK+Gnz9OjmNt1VMBcCX22OeyjJMUmOB84C9lbVqwBJ9gLrgDsGT1+aH7P9tX+k9ge2/cZcpCPNi77mAJIcleRx4BUmv8Qfbl66thnmuSHJu5vYcuCFnsMnmtiR4tIi9G+5/eHz2k5CGkpfy0Cr6k3gtCTHAPckORXYCvwd8C5gO/BZ4HP8fKP0t7zFNPG3SLIJ2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cBrxaVVe1nc8oND2A362q9W3nMgrOAWg+3Ay8D9ib5PEk/6XthOZKM7l9eDuTZ4C7luKXf+NM4JPA2c2/4+PNr2QtEfYAJKmj7AFIUkdZACSpoywAktRRFgBJ6igLgCR1lAVAkjrKAiBJHWUBkKSO+v9myeXJJgpGrQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "pop = np.random.normal(0, 1.15, 100000)\n",
    "plt.hist(pop, bins=100)\n",
    "plt.axvline(pop.mean(), color='yellow', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "\n",
    "\\begin{equation}t = \\frac{\\bar{x} - \\mu}{\\frac{s}{\\sqrt{n}}} \\end{equation}\n",
    "\n",
    "\n",
    "**x&#772;** 样本均值, **&mu;** 均值, **s** 标准差, and **n** 样本数. 当样本数大于30时，t-score接近z-score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "t-statistic:2.773584905660377\n",
      "p-value:0.003911\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGMpJREFUeJzt3X+sXOV95/H3Jy5pqk22QLkhzrVdI3CrELMx9ugaiT+WQgqGuHWJioStJlbKctkV9tpSusV2paVNCrjqNvwuy3XiBdpgajVYMa5r16VBVaRic69rwIZkuSEW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q6fh1AROwEdnb775ZA3w1rnUZV2gnVaWtV2gnVamu5t4M2M7P8eCsIM7OKcgLoMkl/ICkknVd0LHmR9OeSviHpBUnbJJ1ddExZkrRE0jcljUtaV3Q8eZE0W9LXJL0s6ZCkNUXHlCdJMyT9q6QdRcfSLU4AXSRpNvVtMF4rOpac7QHmR8R/AP43sL7geDLTtJ3JtcDFwHJJFxcbVW5OAJ+NiI8AlwG39nFbAdYALxcdRDc5AXTX3cAfAn098RIR/xARJ9LLZ6lf79EvfradSUT8X6CxnUnfiYijEbE/Pf8R9S/HwWKjyoekWcAngC8WHUs3OQF0iaTfBt6IiOeLjqXLfh/4+6KDyFCr7Uz68kuxmaS5wKXA3mIjyc091H+c/bToQLrJN4TJkKR/BD7U4q0/AjYAV3c3ovxM1taI+Gqq80fUhxG+3M3YcqYWZX3do5P0fuArwNqI+GHR8WRN0lLgrYgYk3RF0fF0kxNAhiLi463KJV0CXAA8LwnqQyL7JQ1FxHe6GGJmTtfWBkkrgaXAVdFfa42n3M6kn0g6i/qX/5cj4smi48nJ5cBvS7oOeB/w7yX9dUT8XsFx5c7XARRA0mGgFhH9sOnUu6Sb/nwB+I8RcazoeLIk6ReoT2xfBbxBfXuTFf14Rbvqv1YeBY5HxNqi4+mG1AP4g4hYWnQs3eA5AMvDA8AHgD2SDkj6n0UHlJU0ud3YzuRlYGs/fvknlwOfAq5M/x4PpF/J1ifcAzAzqyj3AMzMKsoJwMysopwAzMwqygnAzKyinADMzCrKCcDMrKKcAMzMKsoJwMysov4/X+7ghXuDgecAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# T-Test\n",
    "t,p = stats.ttest_1samp(sample, 0)\n",
    "\n",
    "p1 = '%f' % (p/2)\n",
    "print (\"t-statistic:\" + str(t))\n",
    "print(\"p-value:\" + str(p1))\n",
    "\n",
    "\n",
    "ci = stats.norm.interval(0.90, 0, 1.15) # 分布（0, 1.15) 90%置信区间\n",
    "plt.hist(pop, bins=100)\n",
    "\n",
    "plt.axvline(pop.mean(), color='yellow', linestyle='dashed', linewidth=2)\n",
    "\n",
    "plt.axvline(ci[1], color='red', linestyle='dashed', linewidth=2)\n",
    "\n",
    "plt.axvline(pop.mean() + t*pop.std(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "黄线是均值，红线是临界线，紫线是P-Value\n",
    "\n",
    "紫线出了置信区间，所以假设${H_{0}}$不成立。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "## 双侧检验\n",
    "\n",
    "对假设：\n",
    "\n",
    "\\begin{equation}H_{0}: \\mu = 0 \\\\ H_{1}: \\mu \\neq 0 \\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "t-statistic:2.773584905660377\n",
      "p-value:0.007822\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGdZJREFUeJzt3X+snNWd3/H3Jw7ZrJq0QHFYYpsagbsKcboGXxkkpJZCFgzxrpeqSDhqYqWUm1bYNVK2i81KJZsU1tvthl9hKXcTd6ENptYGFEO8Zr3ZoFWk8sOXdcCGUG6IBRe8wVmTHygqrcm3f8y5eDD3x9x7nznP88z5vKTRzD3zzJzzjL+e7zzn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ZwAzMwK5QRgZlYoJwAzs0I5AZiZFer/A1lmBEnkQw+fAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "t,p = stats.ttest_1samp(sample, 0)\n",
    "print (\"t-statistic:\" + str(t))\n",
    "\n",
    "print(\"p-value:\" + '%f' % p)\n",
    "\n",
    "ci = stats.norm.interval(0.95, 0, 1.15)\n",
    "plt.hist(pop, bins=100)\n",
    "\n",
    "plt.axvline(pop.mean(), color='yellow', linestyle='dashed', linewidth=2)\n",
    "\n",
    "plt.axvline(ci[0], color='red', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(ci[1], color='red', linestyle='dashed', linewidth=2)\n",
    "\n",
    "plt.axvline(pop.mean() - t*pop.std(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.axvline(pop.mean() + t*pop.std(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "同样的，假设${H_{0}}$不成立。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "\n",
    "## 双样本检验\n",
    "\n",
    "假设有两组学生，一组已经上过课程，另一组没有，有如下假设：\n",
    "\n",
    "\\begin{equation}H_{0}: \\mu_{1} \\le \\mu_{2} \\\\ H_{1}: \\mu_{1} > \\mu_{2} \\end{equation}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "non-math sample mean:66.04066361023553\n",
      "math sample mean:66.52069665713476\n",
      "t-statistic:2.140008413392296\n",
      "p-value:0.016789\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw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uxz+zTwSeBV3py6KuAHBcf1DqCv5vUvA4+T3b9ociqbDDxXxjjT82XAPwE/XoJ/53pxfh04SjYm1Ed2kH0HeEeJYnwc2A5cWlP+AtBRst/l42U7hmriWwQ8UfO6VMfQYHGmstIcQyPdSnkGkE773z7wnGyg5QBZf+X/SNUuA54vJsJMRHwXOCTp3anocrJbW28h+09Beny0gPBOGixOZYvz3AJ8OCJeKyzAZJA490TEuRExPSKmk91PanaqW5YYnwH+luz/JJLeRTboWthNwoaIs1THUI0lnNqtUqpjqMYpcZbtGBqpUl4IJumdwCPp5RnAgxFxm6T/Traa2BnAfwC/GxE9BYUJZFNTgS+THfAvAteSda1tBs4n+2v16og4XliQDBrnbuAs4F9Ttaci4reLiTBTL86IeKXm/T6gMyIK+3Id5Hf578AGYBbwn8AnI+IbRcUIg8b5Xsp3DP042W3i3xkRr6ayn6F8x1C9OHsp2TE0EqVMAGZm1nql7AIyM7PWcwIwM6soJwAzs4pyAjAzqygnADOzinICMDOrKCcAM7OKcgIwM6uo/w+xeNGSop7C5wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "np.random.seed(123)\n",
    "nonMath = np.random.normal(66.0, 1.5, 100)\n",
    "math = np.random.normal(66.55, 1.5, 100)\n",
    "print(\"non-math sample mean:\" + str(nonMath.mean()))\n",
    "print(\"math sample mean:\" + str(math.mean()))\n",
    "\n",
    "\n",
    "t,p = stats.ttest_ind(math, nonMath)\n",
    "\n",
    "p1 = '%f' % (p/2)\n",
    "print(\"t-statistic:\" + str(t))\n",
    "print(\"p-value:\" + str(p1))\n",
    "\n",
    "pop = np.random.normal(nonMath.mean(), nonMath.std(), 100000)\n",
    "\n",
    "ci = stats.norm.interval(0.90, nonMath.mean(), nonMath.std())\n",
    "plt.hist(pop, bins=100)\n",
    "\n",
    "plt.axvline(pop.mean(), color='yellow', linestyle='dashed', linewidth=2)\n",
    "\n",
    "plt.axvline(ci[1], color='red', linestyle='dashed', linewidth=2)\n",
    "\n",
    "plt.axvline(pop.mean() + t*pop.std(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "结论是上过课的人并不比没上过的强。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "## 配对检测\n",
    "\n",
    "上例的两组数据是无关的，如果他们相互依赖呢？\n",
    "\n",
    "比如不是两组不同学生，而是期中和期末考试。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "t-statistic:2.3406857739212583\n",
      "p-value:0.010627\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAGfhJREFUeJzt3X+QXeV93/H3J/xKJnEsURYsS6KiIKe15VqWNhIdT1MCMRJUjiy3ZJA6tkIJcjqIwkzaItHOOLGDELFjDMJlEEZBdIyI6kARWJEsO6EZ/4GkXUXoB9jDGlRrkYLk8iNxmZABf/vHeRYu4t7du7vn1+75vGbO3Huf+9z7fM9KZ797nuc551FEYGZmzfNzVQdgZmbVcAIwM2soJwAzs4ZyAjAzaygnADOzhnICMDNrKCcAM7OGcgIwM2soJwAzs4Y6veoAhnPOOefErFmzqg7DrAv96XF+pVEUrj/t5/wC97MhP8oi9ff3/yQiekaqpzrfCqK3tzf6+vqqDsOsC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
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "np.random.seed(123)\n",
    "midTerm = np.random.normal(59.45, 1.5, 100)\n",
    "endTerm = np.random.normal(60.05, 1.5, 100)\n",
    "\n",
    "\n",
    "t,p = stats.ttest_rel(endTerm, midTerm)\n",
    "\n",
    "p1 = '%f' % (p/2)\n",
    "print(\"t-statistic:\" + str(t))\n",
    "print(\"p-value:\" + str(p1))\n",
    "\n",
    "pop = np.random.normal(midTerm.mean(), midTerm.std(), 100000)\n",
    "\n",
    "ci = stats.norm.interval(0.90, midTerm.mean(), midTerm.std())\n",
    "plt.hist(pop, bins=100)\n",
    "\n",
    "plt.axvline(pop.mean(), color='yellow', linestyle='dashed', linewidth=2)\n",
    "\n",
    "plt.axvline(ci[1], color='red', linestyle='dashed', linewidth=2)\n",
    "\n",
    "plt.axvline(pop.mean() + t*pop.std(), color='magenta', linestyle='dashed', linewidth=2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "source": [
    "期末成绩好于期中成绩。"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Slideshow",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  },
  "livereveal": {
   "scroll": true
  },
  "rise": {
   "enable_chalkboard": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
